sdedic commented on code in PR #8057:
URL: https://github.com/apache/netbeans/pull/8057#discussion_r1894599111
##########
java/maven/src/org/netbeans/modules/maven/api/PluginPropertyUtils.java:
##########
@@ -658,47 +658,36 @@ public List<Dependency> build(Xpp3Dom configRoot,
ExpressionEvaluator eval) {
item.setLocation(PROP_GROUP_ID,
(InputLocation)g.getInputLocation());
}
- Dependency dependencyFromDependencyManagement = null;
- if(dependencyManagement != null &&
dependencyManagement.getDependencies() != null) {
- dependencyFromDependencyManagement =
- dependencyManagement
+ if (v != null) {
+ item.setVersion(v.getValue());
+ item.setLocation(PROP_VERSION,
(InputLocation)v.getInputLocation());
+ } else if (dependencyManagement != null &&
dependencyManagement.getDependencies() != null) {
+ dependencyManagement
.getDependencies()
.stream()
.filter(d -> {
return Objects.equals(item.getGroupId(),
d.getGroupId())
- &&
Objects.equals(item.getArtifactId(), d.getArtifactId());
+ &&
Objects.equals(item.getArtifactId(), d.getArtifactId())
+ &&
Objects.equals(item.getClassifier(), d.getClassifier())
+ && Objects.equals(item.getType(),
d.getType());
Review Comment:
Note that the compiler plugin your comment refers to defaults to `jar` type,
if the `item.getType()` is not defned.
The usage in maven-compiler suggests that each Plugin can choose whatever
default it wants :( for its dependencies ... but as long as
maven-compiler-plugin is used, any `compile` scope type-less artifact has to be
`jar' (otherwise compilation would fail).
Could be solved with an additional `type` parameter that would default to
`jar`.
--
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