From 1131ee49306bb28ec0aba15e1f40e04d80a72fb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bl=C3=A4sing?= Date: Sat, 21 Dec 2024 12:34:48 +0100 Subject: [PATCH] Move DependencyManagement check behind initialisation of the target dependency To be squashed! --- .../maven/api/PluginPropertyUtils.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/java/maven/src/org/netbeans/modules/maven/api/PluginPropertyUtils.java b/java/maven/src/org/netbeans/modules/maven/api/PluginPropertyUtils.java index ddc77410bb62..86248895872a 100644 --- a/java/maven/src/org/netbeans/modules/maven/api/PluginPropertyUtils.java +++ b/java/maven/src/org/netbeans/modules/maven/api/PluginPropertyUtils.java @@ -657,11 +657,23 @@ public List build(Xpp3Dom configRoot, ExpressionEvaluator eval) { item.setGroupId(g.getValue()); item.setLocation(PROP_GROUP_ID, (InputLocation)g.getInputLocation()); } - if (v != null) { item.setVersion(v.getValue()); item.setLocation(PROP_VERSION, (InputLocation)v.getInputLocation()); - } else if (dependencyManagement != null && dependencyManagement.getDependencies() != null) { + } + if (c != null) { + item.setClassifier(c.getValue()); + item.setLocation(PROP_CLASSIFIER, (InputLocation)c.getInputLocation()); + } + if (t != null) { + item.setType(t.getValue()); + item.setLocation(PROP_TYPE, (InputLocation)t.getInputLocation()); + } + if (s != null) { + item.setScope(s.getValue()); + item.setLocation(PROP_SCOPE, (InputLocation)s.getInputLocation()); + } + if (item.getVersion() == null && dependencyManagement != null && dependencyManagement.getDependencies() != null) { dependencyManagement .getDependencies() .stream() @@ -677,18 +689,6 @@ public List build(Xpp3Dom configRoot, ExpressionEvaluator eval) { item.setLocation(PROP_VERSION, d.getLocation(PROP_VERSION)); }); } - if (c != null) { - item.setClassifier(c.getValue()); - item.setLocation(PROP_CLASSIFIER, (InputLocation)c.getInputLocation()); - } - if (t != null) { - item.setType(t.getValue()); - item.setLocation(PROP_TYPE, (InputLocation)t.getInputLocation()); - } - if (s != null) { - item.setScope(s.getValue()); - item.setLocation(PROP_SCOPE, (InputLocation)s.getInputLocation()); - } coords.add(item); } return coords;