This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch maven-4.0.x
in repository https://gitbox.apache.org/repos/asf/maven.git


The following commit(s) were added to refs/heads/maven-4.0.x by this push:
     new be1e367e8e [#14019] Use Commons Logging in Maven Core and the CLI 
(4.0.x backport) (#14137)
be1e367e8e is described below

commit be1e367e8e1b35ad336b5233dac3f563fdab8f2a
Author: Guillaume Nodet <[email protected]>
AuthorDate: Fri Nov 27 09:01:02 2026 +0100

    [#14019] Use Commons Logging in Maven Core and the CLI (4.0.x backport) 
(#14137)
    
    Port of #14110 (merged to maven-3.10.x) to maven-4.0.x.
    
    Replace jcl-over-slf4j with commons-logging:1.4.0 in:
    - compat/maven-resolver-provider: direct runtime dependency swapped
    - apache-maven: CLI distribution uses commons-logging; Wagon HTTP 
transitive bridge excluded
    
    Manage commons-logging:1.4.0 centrally in root POM and ban
    jcl-over-slf4j (compile/runtime scopes) via the existing Enforcer
    rule to prevent regression. Test-scoped usage is allowed.
---
 apache-maven/pom.xml                   | 12 +++++++++---
 compat/maven-resolver-provider/pom.xml |  4 ++--
 pom.xml                                |  9 +++++++++
 src/graph/ReactorGraph.java            |  2 +-
 4 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml
index b33da3aac7..8fdba2ade1 100644
--- a/apache-maven/pom.xml
+++ b/apache-maven/pom.xml
@@ -62,6 +62,12 @@ under the License.
     <dependency>
       <groupId>org.apache.maven.wagon</groupId>
       <artifactId>wagon-http</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>org.slf4j</groupId>
+          <artifactId>jcl-over-slf4j</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.wagon</groupId>
@@ -69,10 +75,10 @@ under the License.
     </dependency>
 
     <!-- CLI -->
+    <!-- Apache Commons Logging routes JCL calls through Maven's SLF4J logger 
-->
     <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>jcl-over-slf4j</artifactId>
-      <version>${slf4jVersion}</version>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
       <scope>runtime</scope>
     </dependency>
     <!-- bridge from java.util.logging (JUL) to SLF4J -->
diff --git a/compat/maven-resolver-provider/pom.xml 
b/compat/maven-resolver-provider/pom.xml
index 1b083e86b8..8f8a240ec5 100644
--- a/compat/maven-resolver-provider/pom.xml
+++ b/compat/maven-resolver-provider/pom.xml
@@ -104,8 +104,8 @@ under the License.
       <artifactId>maven-resolver-transport-apache</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>jcl-over-slf4j</artifactId>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
       <scope>runtime</scope>
     </dependency>
 
diff --git a/pom.xml b/pom.xml
index ae72d6b4ba..0d901af813 100644
--- a/pom.xml
+++ b/pom.xml
@@ -167,6 +167,7 @@ under the License.
     <resolverVersion>2.0.26</resolverVersion>
     <securityDispatcherVersion>4.3.0</securityDispatcherVersion>
     <sisuVersion>1.1.0</sisuVersion>
+    <commonsLoggingVersion>1.4.0</commonsLoggingVersion>
     <slf4jVersion>2.0.20</slf4jVersion>
     <stax2ApiVersion>4.3.2</stax2ApiVersion>
     <wagonVersion>3.5.3</wagonVersion>
@@ -527,6 +528,11 @@ under the License.
         <artifactId>jcl-over-slf4j</artifactId>
         <version>${slf4jVersion}</version>
       </dependency>
+      <dependency>
+        <groupId>commons-logging</groupId>
+        <artifactId>commons-logging</artifactId>
+        <version>${commonsLoggingVersion}</version>
+      </dependency>
       <dependency>
         <groupId>ch.qos.logback</groupId>
         <artifactId>logback-classic</artifactId>
@@ -960,6 +966,9 @@ under the License.
                   <excludes>
                     
<exclude>org.sonatype.plexus:plexus-sec-dispatcher</exclude>
                     <exclude>org.sonatype.plexus:plexus-cipher</exclude>
+                    <!-- ban jcl-over-slf4j in compile/runtime scopes; test 
scope is allowed -->
+                    <exclude>org.slf4j:jcl-over-slf4j:*:jar:compile</exclude>
+                    <exclude>org.slf4j:jcl-over-slf4j:*:jar:runtime</exclude>
                   </excludes>
                   <message>ensure no more org.sonatype.plexus:plexus-cipher 
and org.sonatype.plexus:plexus-sec-dispatcher.</message>
                 </bannedDependencies>
diff --git a/src/graph/ReactorGraph.java b/src/graph/ReactorGraph.java
index 3abb7cc52d..d992f90202 100755
--- a/src/graph/ReactorGraph.java
+++ b/src/graph/ReactorGraph.java
@@ -49,7 +49,7 @@ public class ReactorGraph {
         CLUSTER_PATTERNS.put("XML Parsing", 
Pattern.compile("(.*:woodstox-core:.*)|(.*:stax2-api:.*)"));
         CLUSTER_PATTERNS.put("Wagon", 
Pattern.compile("^org\\.apache\\.maven\\.wagon:.*"));
         CLUSTER_PATTERNS.put("SLF4j", Pattern.compile("^org\\.slf4j:.*"));
-        CLUSTER_PATTERNS.put("Commons", Pattern.compile("^commons-cli:.*"));
+        CLUSTER_PATTERNS.put("Commons", 
Pattern.compile("^commons-(cli|logging):.*"));
         CLUSTER_PATTERNS.put("Testing", 
Pattern.compile("^.*:(mockito-core|junit-jupiter-api):.*"));
     }
     private static final Pattern HIDDEN_NODES = 
Pattern.compile(".*:(maven-docgen|roaster-api|roaster-jdt|velocity-engine-core|commons-lang3|asm|logback-classic|slf4j-simple|domtrip-core|domtrip-maven):.*");

Reply via email to