build: support running Maven with -T1C - #2407
Merged
jaydeluca merged 3 commits intoAug 24, 2026
Merged
Conversation
Several `integration-tests` modules consume the output of other reactor modules without declaring a dependency on them. Maven derives the reactor build order solely from directly declared dependencies, so it does not know that those modules must be built first; serial builds happen to work only because of the module ordering. As a result `mvn -T1C package` races, and `mvn -pl <module> -am` leaves the producing modules out of the reactor altogether. `it-spring-boot-smoke-test` receives `prometheus-metrics-core` only transitively, through `micrometer-registry-prometheus`, so neither `mvn -T1C package` nor `mvn -pl integration-tests/it-spring-boot-smoke-test -am` resolves the snapshot. The dependency is declared with the exclusion that `micrometer-registry-prometheus` applies, leaving the resolved set of artifacts, their versions and their scopes unchanged. `it-exporter-test` and `it-no-protobuf-test` run their sample applications from the shaded jars that the `it-exporter-*-sample` and `it-exporter-no-protobuf` modules leave in `target`, a dependency that `ExporterTest` expresses only as a relative filesystem path. The sample modules are therefore declared as test dependencies. Signed-off-by: Stephan Schroevers <stephan.schroevers@teampicnic.com>
Port 4317 is the default OTLP port, so this test fails on any machine that runs a collector. It also collides with itself: `prometheus-metrics-exporter-opentelemetry-shaded` compiles and runs this module's test sources, so the test executes twice per build, concurrently under `mvn -T`. Signed-off-by: Stephan Schroevers <stephan.schroevers@teampicnic.com>
Stephan202
requested review from
dhoard,
fstab,
jaydeluca and
zeitlinger
as code owners
August 21, 2026 21:42
-T1C-T1C
Contributor
There was a problem hiding this comment.
Pull request overview
Enables reliable multi-threaded (mvn -T, e.g. -T1C) reactor builds by making module build order explicit where Maven can’t infer it from transitive or “side-effect” dependencies, and by removing a fixed-port test dependency that prevents concurrent execution.
Changes:
- Updated
ExemplarTestto use WireMock’s runtime-provided base URL (dynamic port) instead of a fixed4317, allowing concurrent runs. - Added explicit reactor dependencies in integration-test modules so Maven can derive correct build order under
-Tand when using-am.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| prometheus-metrics-exporter-opentelemetry/src/test/java/io/prometheus/metrics/exporter/opentelemetry/ExemplarTest.java | Switch WireMock setup to dynamic port via WireMockRuntimeInfo to avoid fixed-port conflicts in concurrent builds. |
| integration-tests/it-spring-boot-smoke-test/pom.xml | Explicitly declares prometheus-metrics-core (with matching exclusion) to ensure correct reactor ordering under parallel builds. |
| integration-tests/it-exporter/it-no-protobuf-test/pom.xml | Adds explicit dependency on the sample module that produces the shaded jar used by the IT, ensuring correct reactor ordering. |
| integration-tests/it-exporter/it-exporter-test/pom.xml | Adds explicit dependencies on exporter sample modules so their shaded jars are built before the ITs that execute them. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
jaydeluca
approved these changes
Aug 24, 2026
jaydeluca
enabled auto-merge (squash)
August 24, 2026 12:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These two changes enable reliably building multiple Maven modules concurrently with
mvn -T. On my laptop-T1Creducesmvn clean installbuild time from 04:03 to 01:29 minutes.Summary of changes:
ExemplarTestcan be executed twice concurrently (once against the shaded artifact). This change also allows one to build the project on a machine that actually runs an OLTP collector.The changes are split across two commits with suitable commit messages, so that rebase-and-merge is possible.