From 3921588fe05bb4f03aea50869acb438227419c84 Mon Sep 17 00:00:00 2001 From: Mike Lueders Date: Thu, 10 Dec 2015 19:19:31 -0600 Subject: [PATCH 1/2] upgrade bintray plugin since it was throwing an NPE with newer versions of gradle --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index aa77da0..2ab76f8 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ buildscript { } dependencies { classpath 'com.github.townsfolk:gradle-release:1.2' - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:0.5' + classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4' } } From 6795cf0118857d3b9d8371904bd52975a0502db5 Mon Sep 17 00:00:00 2001 From: Mike Lueders Date: Thu, 10 Dec 2015 19:20:00 -0600 Subject: [PATCH 2/2] fixed closure resolution issue with gradle 2.8+ --- .../maven/publish/DependencyResolver.groovy | 2 +- .../publish/MavenPublishExtExtension.groovy | 37 +++++++++---------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/main/groovy/com/bancvue/gradle/maven/publish/DependencyResolver.groovy b/src/main/groovy/com/bancvue/gradle/maven/publish/DependencyResolver.groovy index c6b774b..048884f 100644 --- a/src/main/groovy/com/bancvue/gradle/maven/publish/DependencyResolver.groovy +++ b/src/main/groovy/com/bancvue/gradle/maven/publish/DependencyResolver.groovy @@ -39,7 +39,7 @@ class DependencyResolver { excludeRules.findAll { ExcludeRule excludeRule -> excludeRule.group || excludeRule.module - }.collectAll { ExcludeRule excludeRule -> + }.collect { ExcludeRule excludeRule -> new Exclusion(excludeRule) } } diff --git a/src/main/groovy/com/bancvue/gradle/maven/publish/MavenPublishExtExtension.groovy b/src/main/groovy/com/bancvue/gradle/maven/publish/MavenPublishExtExtension.groovy index 0c71419..cef91f5 100644 --- a/src/main/groovy/com/bancvue/gradle/maven/publish/MavenPublishExtExtension.groovy +++ b/src/main/groovy/com/bancvue/gradle/maven/publish/MavenPublishExtExtension.groovy @@ -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 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 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 } } }