Skip to content

Enable parallel Maven reactor builds in CI - #1665

Merged
tomazfernandes merged 1 commit into
awspring:mainfrom
tomazfernandes:enable-parallel-maven-ci-build
Aug 8, 2026
Merged

Enable parallel Maven reactor builds in CI#1665
tomazfernandes merged 1 commit into
awspring:mainfrom
tomazfernandes:enable-parallel-maven-ci-build

Conversation

@tomazfernandes

@tomazfernandes tomazfernandes commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Motivation

A full verify on CI currently takes ~15 minutes running the 49-module reactor sequentially, while the heavy modules (Kinesis, SQS, SNS, Autoconfigure) spend most of that time waiting on LocalStack interactions rather than using CPU. Five modules account for ~12 of those minutes, and they have no dependency on each other.

Change

Add -T 1C to the Maven invocations in the build and sonar jobs, so independent modules build concurrently (one thread per core; the module remains the unit of parallelism: nothing changes within a module's lifecycle). Wall-clock drops to roughly the longest dependency chain in the reactor instead of the sum of all modules.

Validation

  • Full clean verify -Pspring compared sequential vs -T 1C locally: ~2.4× faster wall-clock.
  • JaCoCo instruments per-module (@{argLine} resolves per surefire fork), and the sonar goal runs once at the end of the reactor, so the coverage pipeline is unaffected by build threading.

Notes

  • Testcontainers handles concurrent LocalStack instances (random host ports, shared Ryuk); Docker deduplicates concurrent pulls of the same image.
  • Known trade-off: module log output interleaves under -T with Maven 3.x, which makes CI failure logs a bit harder to scan. Properly buffered per-module output needs Maven 4.
  • A failure in one module no longer stops unrelated modules mid-flight — you get more of the build's failures per run.

Run the CI verify with -T 1C so independent modules build concurrently.
The reactor currently runs ~15 min sequentially while the test suites are
wait-bound, not CPU-bound; building modules in parallel cuts wall-clock to
roughly the longest dependency chain.
@github-actions github-actions Bot added the type: maintenance Repository maintenance not affecting production files label Aug 2, 2026
@tomazfernandes

tomazfernandes commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@maciejwalkowiak @MatejNedic, this effectively reduces build time from the current 15 minutes to 9 minutes.

I have a few other adjustments with the goal of bringing the total build time to ~5 minutes or less of total run time.

Then I'll suggest we make having a passing build mandatory for merging PRs, to avoid the possibility of having a broken main build such as described in #1662.

Let me know if you have any thoughts or concerns, otherwise I'll merge this PR and it's a simple revert if anything unexpected happens.

@tomazfernandes

Copy link
Copy Markdown
Contributor Author

Merging as aligned internally.

@tomazfernandes
tomazfernandes merged commit 4aac178 into awspring:main Aug 8, 2026
20 of 26 checks passed
tomazfernandes added a commit that referenced this pull request Aug 8, 2026
Run the CI verify with -T 1C so independent modules build concurrently.
The reactor currently runs ~15 min sequentially while the test suites are
wait-bound, not CPU-bound; building modules in parallel cuts wall-clock to
roughly the longest dependency chain, currently at ~9 minutes.

(cherry picked from commit 4aac178)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: maintenance Repository maintenance not affecting production files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant