Skip to content

Instantly share code, notes, and snippets.

@bugs84
Created February 26, 2016 16:07
Show Gist options
  • Save bugs84/b7887fb5d7f9f2d484b8 to your computer and use it in GitHub Desktop.
Save bugs84/b7887fb5d7f9f2d484b8 to your computer and use it in GitHub Desktop.
maven-publish plugin. Hook, change in published pom.xml 'runtime' dependency to compile dependency.
publishing.publications.all {
pom.withXml {
asNode().dependencies.'*'.findAll() {
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep ->
dep.name == it.artifactId.text()
}
}.each { it.scope*.value = 'compile'}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment