gnodet commented on code in PR #595:
URL: https://github.com/apache/maven-resolver/pull/595#discussion_r1818206900
##########
maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/AbstractDependencyManager.java:
##########
@@ -229,37 +231,46 @@ public DependencyManagement manageDependency(Dependency
dependency) {
}
}
+ // system scope paths always applied to have them aligned
+ // (same artifact > same path) in whole graph
if (systemDependencyScope != null
- && (systemDependencyScope.is(scope)
+ && (scope != null &&
systemDependencyScope.is(scope.getValue())
|| (scope == null &&
systemDependencyScope.is(dependency.getScope())))) {
- String localPath = managedLocalPaths.get(key);
+ Holder<String> localPath = managedLocalPaths.get(key);
if (localPath != null) {
if (management == null) {
management = new DependencyManagement();
}
Map<String, String> properties =
new
HashMap<>(dependency.getArtifact().getProperties());
- systemDependencyScope.setSystemPath(properties, localPath);
+ systemDependencyScope.setSystemPath(properties,
localPath.getValue());
management.setProperties(properties);
}
}
- Boolean optional = managedOptionals.get(key);
+ // optional is not managed by model builder
+ // if rule exists, apply it
Review Comment:
> I don't know, but model builder method for managing optional is empty.
Unsure about reasons.
See https://issues.apache.org/jira/browse/MNG-4600 and
https://issues.apache.org/jira/browse/MNG-5227
> And we don't consider depth for optional due that above: as model builder
is not managing it (so it applied even "onto itself").
But then shouldn't the rule considered if `holder.getDepth() == 0 || depth
>= holder.getDepth() + 1` ? Else a dependency may end up being flagged as
optional when it should not ?
--
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]