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/06 22:12:13 UTC

(maven) branch fix/modello-velocity-generate-sources created (now 122275d89f)

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

gnodet pushed a change to branch fix/modello-velocity-generate-sources
in repository https://gitbox.apache.org/repos/asf/maven.git


      at 122275d89f Fix modello velocity goal phase to generate-sources for concurrent builder compatibility

This branch includes the following new commits:

     new 122275d89f Fix modello velocity goal phase to generate-sources for concurrent builder compatibility

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

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

gnodet pushed a commit to branch fix/modello-velocity-generate-sources
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 122275d89fbfbf1eac24aa1579a2260656289484
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Fri Aug 7 00:12:00 2026 +0200

    Fix modello velocity goal phase to generate-sources for concurrent builder compatibility
    
    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 8262c2efde..c646f11476 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 64d53566d3..a2d360df59 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>