This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to branch MNG-7804-plugin-execution-order-3.9
in repository https://gitbox.apache.org/repos/asf/maven.git

commit ef1df676ba67d321442ac9dab05f66625fdfc7ad
Author: HervĂ© Boutemy <[email protected]>
AuthorDate: Sun Jun 18 20:04:05 2023 +0200

    [MNG-7804] Maven 3 priority as XML attribute
---
 .../internal/DefaultLifecyclePluginAnalyzer.java      |  2 +-
 .../resources/projects/future-model-version-pom.xml   |  2 +-
 .../maven/model/validation/DefaultModelValidator.java |  2 +-
 maven-model/src/main/mdo/maven.mdo                    | 19 +++----------------
 4 files changed, 6 insertions(+), 19 deletions(-)

diff --git 
a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java
 
b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java
index 21f99e52a..dd5977764 100644
--- 
a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java
+++ 
b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java
@@ -159,7 +159,7 @@ public class DefaultLifecyclePluginAnalyzer implements 
LifeCyclePluginAnalyzer {
                 PluginExecution execution = new PluginExecution();
                 execution.setId(getExecutionId(plugin, gs.goal));
                 execution.setPhase(phase);
-                execution.setPriority(i - mojos.size());
+                execution.setPriority(1000 * (i - mojos.size()));
                 execution.getGoals().add(gs.goal);
 
                 execution.setLocation("", location);
diff --git 
a/maven-core/src/test/resources/projects/future-model-version-pom.xml 
b/maven-core/src/test/resources/projects/future-model-version-pom.xml
index c8db47aed..1a73a4443 100644
--- a/maven-core/src/test/resources/projects/future-model-version-pom.xml
+++ b/maven-core/src/test/resources/projects/future-model-version-pom.xml
@@ -18,7 +18,7 @@ under the License.
 -->
 
 <project>
-    <modelVersion>4.999.1</modelVersion>
+    <modelVersion>4.0.1</modelVersion>
     <groupId>tests.project</groupId>
     <artifactId>future-model-version</artifactId>
     <version>1</version>
diff --git 
a/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
 
b/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
index a167bcc34..7049f5c21 100644
--- 
a/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
+++ 
b/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
@@ -135,7 +135,7 @@ public class DefaultModelValidator implements 
ModelValidator {
             // models without a version starting with 3.4.
             validateStringNotEmpty("modelVersion", problems, Severity.ERROR, 
Version.V20, m.getModelVersion(), m);
 
-            validateModelVersion(problems, m.getModelVersion(), m, "4.0.0", 
"4.2.0");
+            validateModelVersion(problems, m.getModelVersion(), m, "4.0.0");
 
             validateStringNoExpression("groupId", problems, Severity.WARNING, 
Version.V20, m.getGroupId(), m);
             if (parent == null) {
diff --git a/maven-model/src/main/mdo/maven.mdo 
b/maven-model/src/main/mdo/maven.mdo
index ba90c49cf..4cc8c5001 100644
--- a/maven-model/src/main/mdo/maven.mdo
+++ b/maven-model/src/main/mdo/maven.mdo
@@ -2563,26 +2563,13 @@
           <description>The build lifecycle phase to bind the goals in this 
execution to. If omitted,
             the goals will be bound to the default phase specified by the 
plugin. </description>
         </field>
-        <field xml.transient="true">
-          <name>priority</name>
-          <version>4.0.0/4.1.0</version>
-          <type>int</type>
-          <description>
-            <![CDATA[
-            The priority of this execution compared to other executions which 
are bound to the same phase.
-            <strong>Warning:</strong> This is an internal utility property 
that is only public for technical reasons,
-            it is not part of the public API. In particular, this property can 
be changed or deleted without prior
-            notice.
-            ]]>
-          </description>
-        </field>
-        <field>
+        <field xml.attribute="true">
           <name>priority</name>
-          <version>4.2.0+</version>
+          <version>4.0.0+</version>
           <type>int</type>
           <description>The priority of this execution compared to other 
executions which are bound to the same phase.
             Executions derived from the default lifecycle have a negative 
priority by default so that they are executed
-            before any custom plugin executions.
+            before any custom plugin executions. This field is accessible only 
since Maven 3.9.3, was purely internal before.
           </description>
         </field>
         <field>

Reply via email to