Merge pull request #185 from rwinch/maven-multi-version-artifact

* rwinch-maven-multi-version-artifact:
  Support Gradle/maven with multi version artifacts
This commit is contained in:
Rossen Stoyanchev
2012-11-22 13:22:58 -05:00

View File

@@ -16,10 +16,10 @@ def customizePom(pom, gradleProject) {
pom.whenConfigured { generatedPom ->
// respect 'optional' and 'provided' dependencies
gradleProject.optionalDeps.each { dep ->
generatedPom.dependencies.find { it.artifactId == dep.name }?.optional = true
generatedPom.dependencies.findAll { it.artifactId == dep.name }*.optional = true
}
gradleProject.providedDeps.each { dep ->
generatedPom.dependencies.find { it.artifactId == dep.name }?.scope = 'provided'
generatedPom.dependencies.findAll { it.artifactId == dep.name }*.scope = 'provided'
}
// eliminate test-scoped dependencies (no need in maven central poms)