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


##########
api/maven-api-core/src/main/java/org/apache/maven/api/DependencyScope.java:
##########
@@ -64,7 +69,7 @@ public enum DependencyScope {
     /**

Review Comment:
   Changing `COMPILE` from `isTransitive=true` to `isTransitive=false` has 
cascading effects:
   
   1. `DefaultConsumerPomBuilder.hasDependencyScope()` (line ~300) returns 
`scope == null || !scope.isTransitive()` — after this change, it returns `true` 
for compile scope, causing `removeIf` (lines 267, 285) to strip ALL 
compile-scoped dependencies from consumer POMs. Dependencies with no explicit 
scope default to COMPILE (line 296), so they would also be stripped.
   
   2. `Maven4ScopeManagerConfiguration.buildResolutionScopes()` filters 
`!s.isTransitive()` to build `nonTransitiveDependencyScopes` (lines 140-141). 
After this change, compile joins that set, and its transitive dependencies are 
eliminated during resolution.
   
   This would need version-aware handling — per MNG-8099, compile should only 
become non-transitive for `4.1.0` modelVersion POMs.



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