Skip to content

Commit

Permalink
fixed closure resolution issue with gradle 2.8+
Browse files Browse the repository at this point in the history
  • Loading branch information
mlueders committed Dec 11, 2015
1 parent 3921588 commit 6795cf0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class DependencyResolver {

excludeRules.findAll { ExcludeRule excludeRule ->
excludeRule.group || excludeRule.module
}.collectAll { ExcludeRule excludeRule ->
}.collect { ExcludeRule excludeRule ->
new Exclusion(excludeRule)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,25 +242,24 @@ class MavenPublishExtExtension {
private void attachDependenciesToMavenPublication(ExtendedPublication extendedPublication, MavenPublication mavenPublication) {
Set runtimeDependencies = dependencyResolver.getRuntimeDependencies(extendedPublication)

mavenPublication.pom.withXml {
asNode().children().last() + {
dependencies {
runtimeDependencies.each { Dependency aDependency ->
List<Exclusion> exclusionList = dependencyResolver.getDependencyExclusions(aDependency)

dependency {
groupId aDependency.group
artifactId aDependency.name
version aDependency.version
scope "runtime"

if (exclusionList) {
exclusions {
exclusionList.each { Exclusion item ->
exclusion {
groupId item.groupId
artifactId item.artifactId
}
log.info("Attaching dependencies to maven publication ${mavenPublication.name}")
applyConfigurePomClosureToMavenPublication(mavenPublication) {
dependencies {
runtimeDependencies.each { Dependency aDependency ->
List<Exclusion> exclusionList = dependencyResolver.getDependencyExclusions(aDependency)

dependency {
groupId aDependency.group
artifactId aDependency.name
version aDependency.version
scope "runtime"

if (exclusionList) {
exclusions {
exclusionList.each { Exclusion item ->
exclusion {
groupId item.groupId
artifactId item.artifactId
}
}
}
Expand Down

0 comments on commit 6795cf0

Please sign in to comment.