From c7a59eb0b1d7f8710aab8d06d2adc6d1df80bfa1 Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Sun, 8 Sep 2024 10:58:36 +0200 Subject: [PATCH] Fail build for `static transitive` modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds a Groovy script that fails the build if any optional JPMS module has the `transitive` qualifier. We remove the `transitive` modifier from all optional dependencies. Closes #2929. Co-authored-by: Volkan Yazıcı --- log4j-api/pom.xml | 4 ++- log4j-core/pom.xml | 1 + log4j-parent/pom.xml | 63 ++++++++++++++++++++++++++++++++++++++++++ log4j-to-jul/pom.xml | 4 +++ log4j-to-slf4j/pom.xml | 4 +++ 5 files changed, 75 insertions(+), 1 deletion(-) diff --git a/log4j-api/pom.xml b/log4j-api/pom.xml index 5423c4f99fb..4b0525466df 100644 --- a/log4j-api/pom.xml +++ b/log4j-api/pom.xml @@ -54,7 +54,9 @@ java.sql;static=true, - java.management;static=true + java.management;static=true, + + org.jspecify;transitive=false diff --git a/log4j-core/pom.xml b/log4j-core/pom.xml index 7976c800b5e..1e35ebce729 100644 --- a/log4j-core/pom.xml +++ b/log4j-core/pom.xml @@ -98,6 +98,7 @@ java.naming;transitive=false, org.apache.commons.csv;transitive=false, org.fusesource.jansi;transitive=false, + org.jspecify;transitive=false, org.zeromq.jeromq;transitive=false, com.conversantmedia.disruptor;substitute="disruptor";transitive=false;static=true, diff --git a/log4j-parent/pom.xml b/log4j-parent/pom.xml index 5b4dc64cbcf..9753e45d30f 100644 --- a/log4j-parent/pom.xml +++ b/log4j-parent/pom.xml @@ -53,6 +53,7 @@ 2.2.4 0.45.0 4.13.5 + 3.0.2 2.4 3.5.0 @@ -995,6 +996,68 @@ + + org.codehaus.gmavenplus + gmavenplus-plugin + ${gmavenplus-plugin.version} + + + org.codehaus.groovy + groovy-ant + ${groovy.version} + runtime + + + org.codehaus.groovy + groovy + ${groovy.version} + runtime + + + + + ban-static-transitive + + execute + + verify + + false + + + + + + + + diff --git a/log4j-to-jul/pom.xml b/log4j-to-jul/pom.xml index 25caed1639f..54899fad282 100644 --- a/log4j-to-jul/pom.xml +++ b/log4j-to-jul/pom.xml @@ -34,6 +34,10 @@ org.jspecify.*;resolution:=optional + + + org.jspecify;transitive=false + diff --git a/log4j-to-slf4j/pom.xml b/log4j-to-slf4j/pom.xml index 45907097dc5..50732f24c96 100644 --- a/log4j-to-slf4j/pom.xml +++ b/log4j-to-slf4j/pom.xml @@ -45,6 +45,10 @@ org.slf4j.*;version="${slf4j.support.range}" + + + org.jspecify;transitive=false + 2.0.16