Created
December 22, 2014 00:15
-
-
Save mrserverless/1ef286f8f4a693bfbeda to your computer and use it in GitHub Desktop.
Gradle maven publish replace default runtime scope with compile scope. See: http://forums.gradle.org/gradle/topics/using_the_maven_publish_plugin_no_dependencies_in_pom_xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
publishing { | |
publications { | |
mavenJava(MavenPublication) { | |
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' | |
} | |
} | |
from components.java | |
artifact sourcesJar { | |
classifier "sources" | |
} | |
artifact javadocJar { | |
classifier "javadoc" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment