cstamas commented on code in PR #1815:
URL: https://github.com/apache/maven-resolver/pull/1815#discussion_r3002348702
##########
maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/TransitiveDependencyManager.java:
##########
@@ -145,30 +145,4 @@ protected DependencyManager newInstance(
managedExclusions,
systemDependencyScope);
}
-
- /**
- * Controls inheritance-based property derivation for scope and optional
properties.
- * <p>
- * <strong>Why scope and optional are special:</strong> In dependency
graphs, these two properties
- * are subject to inheritance during graph transformation (which is
outside ModelBuilder's scope).
- * Therefore, scope and optional are derived only from the root to prevent
interference with
- * inheritance logic.
- * </p>
- * <p>
- * <strong>The inheritance problem:</strong> If we managed scope/optional
from sources below the root,
- * we would mark nodes as "managed" in the dependency graph. The "managed"
flag means "do not touch it,
- * it is as it should be", which would prevent proper inheritance
application during later graph
- * transformation, causing nodes to end up with incorrect scope or
optional states.
- * </p>
- * <p>
- * <strong>Special case:</strong> The "system" scope has special handling
due to its unique path requirements.
- * </p>
- *
- * @return true only at depth 0 (root level) to ensure inheritance-based
properties are only
- * derived from the root, false otherwise
- */
- @Override
- protected boolean isInheritedDerived() {
- return depth == 0;
- }
}
Review Comment:
Yes, this is intentional. But, those will be now applied as "advices" and
not as "enforced changes". In case of "nearest" winner selection this should
not produce any change in case of conflict (same behavior remains), while it
may produce proper "transitive dependency management" in other cases. Where it
gets interesting is the use of "highest" winner selection strategy.
--
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]