Browse Source

Support Gradle/maven with multi version artifacts

Previously the publish-maven.gradle only supported having a single
artifact be marked as optional or provided. This causes problems now
that we are building modules that support multiple versions of an
artifact. For example, we compile against two versions of Tiles
artifacts with identical names, both of which need to be marked
optional.

This updates publish-maven.gradle to find all the artifacts and mark
them as optional as apposed to the first entry.
pull/185/merge
Rob Winch 14 years ago committed by Rossen Stoyanchev
parent
commit
39d419bbc3
  1. 4
      publish-maven.gradle

4
publish-maven.gradle

@ -16,10 +16,10 @@ def customizePom(pom, gradleProject) { @@ -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)

Loading…
Cancel
Save