From ec2895dbef8c3135bbc166dc2f598c948bf59312 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Mon, 23 Jan 2017 07:10:22 +0100 Subject: [PATCH] Gradle: maven publish generated pom, dependencies with scope runtime instead of compile https://discuss.gradle.org/t/maven-publish-plugin-generated-pom-making-dependency-scope-runtime/7494/13 --- SpringJava/Gradle/build.gradle | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/SpringJava/Gradle/build.gradle b/SpringJava/Gradle/build.gradle index be5d22e..1657670 100644 --- a/SpringJava/Gradle/build.gradle +++ b/SpringJava/Gradle/build.gradle @@ -103,6 +103,16 @@ subprojects { artifact javadocJar { classifier 'javadoc' } + + 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' + } + } } } repositories { -- 2.1.4