gnodet commented on code in PR #12745:
URL: https://github.com/apache/maven/pull/12745#discussion_r3793930467


##########
api/maven-api-core/src/main/java/org/apache/maven/api/DependencyScope.java:
##########
@@ -64,7 +64,12 @@ public enum DependencyScope {
     /**
      * Compile, runtime and test.
      */
-    COMPILE("compile", true),
+    COMPILE("compile", false),

Review Comment:
   **Critical regression**: Changing `COMPILE` from `transitive=true` to 
`transitive=false` has cascading effects:
   
   1. `DefaultConsumerPomBuilder.hasDependencyScope()` uses 
`!scope.isTransitive()` to decide which dependencies to strip from consumer 
POMs. With this change, **all compile-scoped dependencies** (the most common 
case, since compile is the default scope) will be silently removed from 
consumer POMs.
   
   2. `Maven4ScopeManagerConfiguration` passes 
`DependencyScope.COMPILE.isTransitive()` to `createDependencyScope()`. COMPILE 
now falls into `nonTransitiveDependencyScopes` in `buildResolutionScopes()`, 
causing the resolver to eliminate transitive dependencies of compile-scoped 
libraries.
   
   At minimum, `DefaultConsumerPomBuilder.hasDependencyScope()` needs to be 
updated to not rely on `isTransitive()` for consumer POM inclusion, and the 
compile-to-non-transitive behavior should be gated on model version so 4.0.0 
projects retain current behavior.



-- 
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