From 35833fe21e48eff626e21e5141e493a8af1df9da Mon Sep 17 00:00:00 2001 From: Ciprian Ciubotariu Date: Wed, 28 Jun 2017 00:26:11 +0300 Subject: [PATCH] Fix dependency scope for maven publisher The proper dependency scope should be compile, but gradle erroneously uses scope=runtime by default. --- .gitignore | 1 + build.gradle | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/.gitignore b/.gitignore index 2d40a75..386d532 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ gradle-app.setting *.ipr *.iws generator/generator +/.nb-gradle/ \ No newline at end of file diff --git a/build.gradle b/build.gradle index 8ef6b4b..26137fb 100644 --- a/build.gradle +++ b/build.gradle @@ -24,6 +24,18 @@ task javadocJar(type: Jar) { publishing { publications { sdk(MavenPublication) { + groupId 'io.rancher' + artifactId 'rancher-java-sdk' + version '1.0.0' + + 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 sourceJar { classifier 'sources'