Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add modifyPom(Closure) utility to build scripts for POM fine tuning.

  • Loading branch information...
commit 0b4429a1e71022c04b066fb274060203f7678a97 1 parent ae69788
@alkemist alkemist authored
Showing with 18 additions and 1 deletion.
  1. +18 −1 build.gradle
View
19 build.gradle
@@ -154,7 +154,7 @@ subprojects { project ->
mavenRepo urls: url
- repositories.mavenDeployer {
+ project.deployer = repositories.mavenDeployer {
repository(url: url) {
beforeDeployment { deployment ->
["sources", "javadoc"].each { type ->
@@ -174,6 +174,23 @@ subprojects { project ->
}
}
uploadArchives.dependsOn sourcesJar, javadocJar
+
+
+ /*
+ Install a method that can be used to fine tune the poms, e.g…
+
+ modifyPom { pom ->
+ pom.dependencies.removeAll(pom.dependencies.findAll { it.scope == "test" })
+ }
+
+ Mods are run in order they are encountered in the build script
+ */
+ project.poms = [project.install.repositories.mavenInstaller.pom, project.deployer.pom]
+ project.pomModifications = []
+ project.modifyPom = { Closure modification -> project.pomModifications << modification }
+ project.poms*.whenConfigured {
+ project.pomModifications*.call(it)
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.