Skip to content

Commit 852e66a

Browse files
gnodetclaude
andauthored
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 <noreply@anthropic.com>
1 parent 833a64b commit 852e66a

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

api/maven-api-settings/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ under the License.
7676
<id>modello</id>
7777
<goals>
7878
<goal>velocity</goal>
79+
</goals>
80+
<phase>generate-sources</phase>
81+
</execution>
82+
<execution>
83+
<id>modello-docs</id>
84+
<goals>
7985
<goal>xdoc</goal>
8086
<goal>xsd</goal>
8187
</goals>

api/maven-api-toolchain/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ under the License.
6767
<id>modello</id>
6868
<goals>
6969
<goal>velocity</goal>
70+
</goals>
71+
<phase>generate-sources</phase>
72+
</execution>
73+
<execution>
74+
<id>modello-docs</id>
75+
<goals>
7076
<goal>xdoc</goal>
7177
<goal>xsd</goal>
7278
</goals>

0 commit comments

Comments
 (0)