From 265e841e56af53d2c1760a8fc1c827051cff18d4 Mon Sep 17 00:00:00 2001 From: James House Date: Wed, 19 Apr 2023 16:51:06 -0400 Subject: [PATCH 1/2] Apply overrides for maven scopes on dependencies Signed-off-by: James House --- build.gradle | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/build.gradle b/build.gradle index 0ad297da9..06ab729ad 100644 --- a/build.gradle +++ b/build.gradle @@ -37,6 +37,10 @@ allprojects { } publishing { + configurations { + provided + runtimeClasspath.extendsFrom(provided) + } publications { maven(MavenPublication) { pom { @@ -62,7 +66,23 @@ allprojects { } } } + from components.java + pom.withXml { + asNode() + .dependencies + .dependency + .findAll { dependency -> + // Patch up dependency scopes per expectations of maven users + (dependency.groupId.text() == 'com.mchange' || + dependency.groupId.text() == 'com.zaxxer' || + dependency.artifactId.text() == 'slf4j-log4j12') + } + .each { dependency -> + // Set scope value to compile. + dependency.scope*.value = 'provided' + } + } } } } From 360f8104e606ad9b7be0844330024accf3b196cd Mon Sep 17 00:00:00 2001 From: James House Date: Thu, 20 Apr 2023 08:24:09 -0400 Subject: [PATCH 2/2] also make java.xml 'provided' scope Signed-off-by: James House --- build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 06ab729ad..aae056fc8 100644 --- a/build.gradle +++ b/build.gradle @@ -76,7 +76,8 @@ allprojects { // Patch up dependency scopes per expectations of maven users (dependency.groupId.text() == 'com.mchange' || dependency.groupId.text() == 'com.zaxxer' || - dependency.artifactId.text() == 'slf4j-log4j12') + dependency.artifactId.text() == 'slf4j-log4j12' || + dependency.groupId.text() == 'javax.xml' ) } .each { dependency -> // Set scope value to compile.