gnodet commented on code in PR #13897:
URL: https://github.com/apache/maven/pull/13897#discussion_r4592630323
##########
impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlanExecutor.java:
##########
@@ -174,6 +174,30 @@ public class BuildPlanExecutor {
private volatile List<Lifecycle> processedLifecyclesCache;
+ @SuppressWarnings("checkstyle:ParameterNumber")
Review Comment:
This change is not needed.
##########
api/maven-api-model/src/main/mdo/maven.mdo:
##########
@@ -1312,6 +1312,26 @@
<multiplicity>*</multiplicity>
</association>
</field>
+ <field>
+ <name>includes</name>
Review Comment:
We have `exclusion`, so to be coherent, it should be `inclusion`.
##########
impl/maven-core/src/test/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlanCreatorTest.java:
##########
@@ -501,8 +501,9 @@ void testReactorPluginPreCompilePhase() {
// Without the fix, "ready" (and compile/package/…) would be skipped
for p2 because
// "initialize" ends well before "ready" in the lifecycle.
DefaultLifecycleRegistry lifecycles = new
DefaultLifecycleRegistry(Collections.emptyList());
- BuildPlanExecutor.BuildContext context =
Review Comment:
This change is not needed afaik.
##########
impl/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/DefaultConsumerPomBuilder.java:
##########
@@ -146,6 +153,22 @@ public Model build(RepositorySystemSession session,
MavenProject project, ModelS
+ " 3. Remove the mixins from your POM");
}
+ // Check if dependency includes are present without
preserveModelVersion enabled
+ if ((hasDependencyIncludes(model)
+ || (project.getOriginalModel() != null
Review Comment:
Why do we check both `model` and `project.getOriginalModel()` ?
##########
impl/maven-core/src/test/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlanCreatorTest.java:
##########
@@ -582,8 +583,9 @@ void
testReactorPluginWithLibraryDependencyPreCompilePhase() {
projects.put(p1, Collections.singletonList(p2));
DefaultLifecycleRegistry lifecycles = new
DefaultLifecycleRegistry(Collections.emptyList());
- BuildPlanExecutor.BuildContext context =
Review Comment:
This change is not needed.
##########
impl/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/DefaultConsumerPomBuilder.java:
##########
@@ -89,6 +89,13 @@
* <li>Otherwise, an exception is thrown requiring one of the above options
or manual mixin removal</li>
* </ul>
* <p>
+ * <b>Dependency Inclusions Handling</b>: Dependency inclusions ({@code
<includes>}) on BOM imports are only supported
+ * in model version 4.2.0 or later. If a POM contains dependency inclusions:
Review Comment:
The `DefaultModelValidator` should enforce that:
* `inclusions` are only used with `modelVersion > 4.2.0`
* only if `model.isPreserveModelVersion()=true`
* only on BOM imports
##########
impl/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/DefaultConsumerPomBuilder.java:
##########
@@ -146,6 +153,22 @@ public Model build(RepositorySystemSession session,
MavenProject project, ModelS
+ " 3. Remove the mixins from your POM");
}
+ // Check if dependency includes are present without
preserveModelVersion enabled
+ if ((hasDependencyIncludes(model)
Review Comment:
I wonder if this check should be moved to `DefaultModelValidator`, and have
the validator called before installing / deploying a model. This would ensure
no one can write a model which can't be consumed.
--
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]