sdedic commented on code in PR #8057:
URL: https://github.com/apache/netbeans/pull/8057#discussion_r1894598582
##########
java/maven/src/org/netbeans/modules/maven/api/PluginPropertyUtils.java:
##########
@@ -652,21 +657,48 @@ public List<Dependency> build(Xpp3Dom configRoot,
ExpressionEvaluator eval) {
item.setGroupId(g.getValue());
item.setLocation(PROP_GROUP_ID,
(InputLocation)g.getInputLocation());
}
+
+ Dependency dependencyFromDependencyManagement = null;
+ if(dependencyManagement != null &&
dependencyManagement.getDependencies() != null) {
+ dependencyFromDependencyManagement =
+ dependencyManagement
+ .getDependencies()
+ .stream()
+ .filter(d -> {
+ return Objects.equals(item.getGroupId(),
d.getGroupId())
+ &&
Objects.equals(item.getArtifactId(), d.getArtifactId());
+ })
+ .findFirst()
+ .orElse(null);
+ }
+
if (v != null) {
item.setVersion(v.getValue());
item.setLocation(PROP_VERSION,
(InputLocation)v.getInputLocation());
+ } else if (dependencyFromDependencyManagement != null) {
+
item.setVersion(dependencyFromDependencyManagement.getVersion());
+ item.setLocation(PROP_VERSION,
dependencyFromDependencyManagement.getLocation(PROP_VERSION));
}
if (c != null) {
item.setClassifier(c.getValue());
item.setLocation(PROP_CLASSIFIER,
(InputLocation)c.getInputLocation());
+ } else if (dependencyFromDependencyManagement != null) {
Review Comment:
Apologies for the delay.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists