You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by gn...@apache.org on 2026/08/31 01:55:00 UTC

(maven) branch backport/12687-to-maven-4.0.x created (now d25115deea)

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

gnodet pushed a change to branch backport/12687-to-maven-4.0.x
in repository https://gitbox.apache.org/repos/asf/maven.git


      at d25115deea Fix modello velocity goal phase to generate-sources for concurrent builder compatibility (#12687)

This branch includes the following new commits:

     new d25115deea Fix modello velocity goal phase to generate-sources for concurrent builder compatibility (#12687)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(maven) 01/01: Fix modello velocity goal phase to generate-sources for concurrent builder compatibility (#12687)

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch backport/12687-to-maven-4.0.x
in repository https://gitbox.apache.org/repos/asf/maven.git

commit d25115deea251a47bb47bae60f6feac2e15fd12a
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Mon Aug 31 03:54:02 2026 +0200

    Fix modello velocity goal phase to generate-sources for concurrent builder compatibility (#12687)
    
    In the Maven 4 graph lifecycle model, the SOURCES and RESOURCES phases
    are parallel siblings under BUILD, and COMPILE depends on SOURCES
    (via after(SOURCES)) but not on RESOURCES. The modello velocity goal
    generates Java source files, but was bound to generate-resources
    (mapped to the RESOURCES phase), creating a race condition with the
    concurrent builder (-b concurrent): COMPILE could start before
    the velocity goal finished generating Java sources.
    
    This caused "package does not exist" compilation errors when running
    `mvn build -T1C -b concurrent` without clean, because upstream
    modules built fast enough (incremental) that COMPILE started before
    modello had called addCompileSourceRoot(). With clean, upstream
    rebuilds took longer, masking the race.
    
    Split the modello execution so velocity (Java source generation) runs
    at generate-sources (SOURCES phase) and xdoc/xsd (documentation)
    stay at generate-resources (RESOURCES phase), matching the pattern
    already used by maven-api-model.
    
    Co-authored-by: Claude Opus 4.6 <no...@anthropic.com>
---
 api/maven-api-settings/pom.xml  | 6 ++++++
 api/maven-api-toolchain/pom.xml | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/api/maven-api-settings/pom.xml b/api/maven-api-settings/pom.xml
index e923e820ed..3d79f17707 100644
--- a/api/maven-api-settings/pom.xml
+++ b/api/maven-api-settings/pom.xml
@@ -76,6 +76,12 @@ under the License.
             <id>modello</id>
             <goals>
               <goal>velocity</goal>
+            </goals>
+            <phase>generate-sources</phase>
+          </execution>
+          <execution>
+            <id>modello-docs</id>
+            <goals>
               <goal>xdoc</goal>
               <goal>xsd</goal>
             </goals>
diff --git a/api/maven-api-toolchain/pom.xml b/api/maven-api-toolchain/pom.xml
index 108275549d..a1d0c5b650 100644
--- a/api/maven-api-toolchain/pom.xml
+++ b/api/maven-api-toolchain/pom.xml
@@ -67,6 +67,12 @@ under the License.
             <id>modello</id>
             <goals>
               <goal>velocity</goal>
+            </goals>
+            <phase>generate-sources</phase>
+          </execution>
+          <execution>
+            <id>modello-docs</id>
+            <goals>
               <goal>xdoc</goal>
               <goal>xsd</goal>
             </goals>