slachiewicz opened a new issue, #13822: URL: https://github.com/apache/maven/issues/13822
### New feature, improvement proposal Integration tests are most of the CI time in the Maven plugins and shared libraries. This issue tracks a plan to cut it: run fewer CI combinations, run ITs in parallel by default, and configure them in one place, the parent POMs, instead of in every repository. ## Baseline Measured on 2026-11-03 from the last 1–3 green push runs of 150 repositories (apache/maven-\*, codehaus-plexus, mojohaus, eclipse-sisu), default branches plus the 13 maintenance lines. Single-run figures are approximate; runner speed varies up to 1.6×. - One push to each of the 141 workflows above 3 job-minutes costs about 7,850 job-minutes: Windows 40%, Linux 34%, macOS 26%. - ITs take 78–99% of a build. One Windows JDK 21 job per repository, split by plugin goal: | Repository | Build (min) | ITs (min) | ITs | Mode | | --- | --- | --- | --- | --- | | maven-invoker-plugin | 18.0 | 17.6 | 92 | serial | | maven-assembly-plugin | 16.1 | 15.6 | 152 | serial | | maven-enforcer | 12.0 | 11.4 | 156 | serial | | maven-shade-plugin | 9.5 | 8.9 | 94 | serial | | maven-pmd-plugin | 9.1 | 8.2 | 44 | serial | | maven-dependency-plugin | 8.3 | 6.7 | 140 | parallel | | maven-compiler-plugin | 7.1 | 6.6 | 80 | serial | | maven-release | 4.6 | 3.6 | 55 | serial | - Each IT costs 4–11 s, mostly starting a forked Maven. Only maven-dependency-plugin, maven-gpg-plugin and maven-project-info-reports-plugin set `invoker.parallelThreads`; the parent POMs set none. - The most expensive build is maven-javadoc-plugin: 96 jobs (5 JDK vendors × 4 JDKs × 3 OS × 2 Maven versions), 1,019 job-minutes and about 75 minutes to finish. ## How ITs are configured today 93 of 128 repositories have ITs. 59 run them with maven-invoker-plugin (9 of them also with failsafe), and checks are Groovy (2,169 scripts, 7 BeanShell left). What differs is where the configuration lives: - `maven-plugins` defines a `run-its` profile; `mojo-parent` and `plexus-pom` define none, so 26 mojohaus repositories each define their own. - 34 apache repositories repeat maven-parent's own invoker defaults in 152 lines (`localRepositoryPath`, `cloneProjectsTo`, `settingsFile`, hook script names, `debug`). - Test repositories: `src/it/settings.xml` in 37 repositories (about 16 versions; 30 share one), mrm in 17 (10 versions of its settings). - Parallel ITs in 17 of 26 mojohaus repositories and 6 of 57 apache ones; a lighter forked JVM in 18 and 4. ## Plan 1. Decide the questions below. 2. One `run-its` profile, the same in maven-parent, mojo-parent and plexus-pom: invoker goals, paths, `verify`/`setup` hooks, `streamLogsOnFailures`, one rerun, the shared `settings.xml`, `invoker.parallelThreads` 0.75C, and a lighter forked JVM through `mavenOpts` (not `JAVA_TOOL_OPTIONS`, whose stderr line breaks ITs that check stderr). Repositories drop their copies at their next parent update. 3. Shared workflow: fewer OS × JDK combinations by default (all JDKs on Linux, newest on macOS, oldest and newest on Windows). Estimated 5,769 → 3,664 job-minutes per round across the 86 repositories on its default matrix (about −36%). 4. Extra JDK vendors on Linux only in maven-javadoc-plugin (1,019 → 435 job-minutes), maven-compiler-plugin (394 → 182) and maven-jdeps-plugin (86 → 39). 5. Build the test project with `ProjectBuilder` in both plugin test harnesses (maven-plugin-testing 3.x and `impl/maven-testing`), so ITs that only check how parameters shape the output can become unit tests on `master` and `-4.x` alike. 6. Move maven-invoker-plugin from the deprecated maven-invoker onto maven-executor, keeping every `invoker.properties` and check script; then measure embedded mode, which avoids the per-IT JVM start but runs one build at a time per JVM. Parallel ITs are safe in CI: Maven 3.10.0 (resolver 2.0.24) and 4.0 lock the local repository across processes by default. The only recorded blocker, a comment in maven-compiler-plugin's workflow, dates from 2022. Local builds on Maven 3.9 need `-Daether.syncContext.named.factory=file-lock`, which the profile can pass. ## Questions - @cstamas: is file locking across processes enough for parallel invoker ITs sharing one `target/local-repo`, on resolver 1.9 and 2.0? And is maven-invoker-plugin on maven-executor the direction you want for executor 2.x? - @slawekjaranowski: one `run-its` profile in the three parents, and the smaller default matrix in the shared workflow: acceptable as defaults, with per-repository opt-outs? - @gnodet: building the project through `ProjectBuilder` in `impl/maven-testing` when `@MojoTest(realSession = true)` is set: fine with you? ## Related - maven-executor fixes: apache/maven-executor#80, #81, #82, #83, #84 (issues #76–#79, #48, #58), contributor PRs #55 and #53. - maven-testing fixes: #13814, #13815, #13816, #13817 (issues #13810–#13813). -- 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]
