Skip to content

Commit

Permalink
Support Gradle/maven with multi version artifacts
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rwinch authored and rstoyanchev committed Nov 22, 2012
1 parent b7f7fae commit 39d419b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions publish-maven.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 39d419b

Please sign in to comment.