hazendaz opened a new issue, #14019:
URL: https://github.com/apache/maven/issues/14019

   ### Affected version
   
   3.10.1
   
   ### Bug description
   
   ## Title
   
   `jcl-over-slf4j` is still exposed through Maven Core's Resolver 
compatibility path
   
   ## Description
   
   The changes intended to remove `jcl-over-slf4j` from Maven's exposed 
dependencies have not actually eliminated it from the Maven runtime.
   
   Although the dependency was made optional in Resolver, Maven Core 
subsequently reintroduced it through the Maven 3.10.1 compatibility code. As a 
result, the bridge is still present in the effective runtime dependency graph 
and continues to leak through Maven Core.
   
   See example using enforcer to block jcl-over-slf4j from maven-core within a 
maven plugin.
   ```error
   ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-enforcer-plugin:3.6.3:enforce (enforce-clean) on 
project coveralls-maven-plugin:
   [ERROR] Rule 0: 
org.apache.maven.enforcer.rules.dependency.BannedDependencies failed with 
message:
   [ERROR] Do not use obsolete logging libraries.  Prefer slf4j/logback and 
override slf4j libraries for replacements.  Use only commons-logging when 
needed and no overrides from any of the major logging providers.
   [ERROR] 
com.github.hazendaz.maven:coveralls-maven-plugin:maven-plugin:5.1.1-SNAPSHOT
   [ERROR]    org.apache.maven:maven-core:jar:3.10.1
   [ERROR]       org.apache.maven:maven-resolver-provider:jar:3.10.1
   [ERROR]          org.slf4j:jcl-over-slf4j:jar:2.0.20 <--- banned via the 
exclude/include list
   ```
   
   This defeats the original objective of removing the dependency. Making it 
optional in one location does not solve the problem if Maven Core brings it 
back through another path.
   
   ## Proposed direction
   
   My original recommendation was to move away from `jcl-over-slf4j` rather 
than simply hide or make the dependency optional.
   
   Commons Logging already provides the appropriate logging abstraction and 
delegation mechanism, and moving to it would avoid carrying the additional 
JCL-to-SLF4J bridge. It also offers a better-performing approach than retaining 
the bridge.
   
   I would strongly prefer addressing the underlying logging dependency 
arrangement rather than continuing to add compatibility-specific exceptions 
that reintroduce the dependency.
   
   ## Expected outcome
   
   - `jcl-over-slf4j` should no longer be present in Maven Core's effective 
runtime dependency graph.
   - Resolver's Maven 3.10.1 compatibility code should not reintroduce the 
dependency.
   - The original logging migration should be completed consistently across 
Maven Core and Resolver.
   - Verify the actual Maven distribution/runtime dependencies, rather than 
checking only whether the dependency is optional or absent from an individual 
POM.
   
   The current implementation gives the appearance of having removed the 
dependency while retaining it in the actual runtime. That is not a completed 
migration.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to