gnodet commented on code in PR #13897:
URL: https://github.com/apache/maven/pull/13897#discussion_r4560603652
##########
impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelValidator.java:
##########
@@ -1271,6 +1279,29 @@ private void validate20RawDependencies(
}
}
+ if (!is42OrBeyond && !dependency.getIncludes().isEmpty()) {
+ addViolation(
+ problems,
+ Severity.ERROR,
+ Version.V42,
+ prefix + prefix2 + "includes",
+ SourceHint.dependencyManagementKey(dependency),
+ "'includes' is only supported with modelVersion 4.2.0
or higher; "
+ + "use modelVersion 4.2.0 or remove
'includes'.",
+ dependency);
+ }
+
+ if (!dependency.getIncludes().isEmpty() &&
!"import".equals(dependency.getScope())) {
+ addViolation(
+ problems,
+ Severity.WARNING,
Review Comment:
`<includes>` on a non-`import`-scoped dependency is semantically meaningless
— there is no BOM to filter. This should be `Severity.ERROR`, not
`Severity.WARNING`. A WARNING allows silently publishing consumer POMs with
no-op `<includes>` elements that will confuse downstream consumers.
--
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]