Skip to content

Instantly share code, notes, and snippets.

@jkschneider
Last active September 17, 2015 23:32
Show Gist options
  • Save jkschneider/885dea988a215db49f43 to your computer and use it in GitHub Desktop.
Save jkschneider/885dea988a215db49f43 to your computer and use it in GitHub Desktop.
Alteration to default behavior of nebula-publish (and indeed Gradle's maven-publish behavior) to produce compile scoped dependencies in the POM
publishing {
publications {
nebula(MavenPublication) {
pom.withXml {
configurations.compile.resolvedConfiguration.firstLevelModuleDependencies.each { dep ->
asNode().dependencies[0].dependency.find {
it.artifactId[0].text() == dep.moduleName &&
it.groupId[0].text() == dep.moduleGroup
}.scope[0].value = 'compile'
}
}
}
}
}
publishing {
publications {
nebula(MavenPublication) {
pom.withXml {
asNode().dependencies[0].dependency.find { it.artifactId[0].text() == 'rxjava' }.scope[0].value = 'compile'
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment