Skip to content

build: compile in-process rather than by forking javac - #5366

Merged
joschi merged 1 commit into
dropwizard:release/5.0.xfrom
Stephan202:improvement/speed-up-build
Aug 28, 2026
Merged

joschi merged 1 commit into
dropwizard:release/5.0.xfrom
Stephan202:improvement/speed-up-build

Conversation

@Stephan202

Copy link
Copy Markdown
Contributor

(I coded this change against the 5.0.x release branch before noticing in the README that this branch is "on pause"; happy to (also) file a PR for 4.2.x if desired.)

Suggested commit message:

build: compile in-process rather than by forking `javac`

The `--add-exports`/`--add-opens` flags required by Error Prone are 
currently passed as `-J` compiler arguments, which requires
`<fork>true</fork>`. Declaring them in `.mvn/jvm.config` instead lets
the compiler run inside the Maven JVM, significantly speeding up the 
build.

On my laptop this change speeds up the build by ~32%:

  • mvn clean install: 3m43s -> 2m31s
  • mvn -T1C clean install -> 1m49s -> 1m15s

Reason for opening this PR: our project runs an integration test against Dropwizard Metrics' code base, and the associated GitHub Actions builds increasingly often time out. Next to optimizing our test setup, just speeding up the build under test helps too :)

The `--add-exports`/`--add-opens` flags required by Error Prone are
currently passed as `-J` compiler arguments, which requires
`<fork>true</fork>`. Declaring them in `.mvn/jvm.config` instead lets
the compiler run inside the Maven JVM, significantly speeding up the
build.
@Stephan202
Stephan202 requested review from a team as code owners August 21, 2026 18:14
@github-actions github-actions Bot added this to the 5.0.8 milestone Aug 21, 2026
@joschi

joschi commented Aug 28, 2026

Copy link
Copy Markdown
Member

@Stephan202 Thank you for your contribution! ❤️

@joschi
joschi merged commit e11aade into dropwizard:release/5.0.x Aug 28, 2026
5 checks passed
@Stephan202
Stephan202 deleted the improvement/speed-up-build branch August 30, 2026 09:53
Stephan202 added a commit to PicnicSupermarket/error-prone-support that referenced this pull request Sep 1, 2026
Summary of changes:
- Upgrade `checkstyle` 12.0.1 -> 14.0.0
- Upgrade `metrics` 5.0.5 -> 5.0.8
- Upgrade `prometheus-java-client` 1.4.1 -> 1.8.0

The targets are now built using JDK 25 rather than JDK 21, so the
workflow installs a single JDK. The `prometheus-java-client` build
gates its `examples`, `benchmarks` and `integration-tests` modules on
JDK 25; on an older JDK those modules silently drop out of the reactor.

The `metrics` initialization patch shrinks considerably, as
dropwizard/metrics#5366 landed. The
`prometheus-java-client` patch instead grows, as the project no longer
puts Guava on the compile classpath of all modules. The `checkstyle`
patch drops several suppressions that the upgraded code no longer
warrants, but must now skip the new search index generation step and
declare two properties that the project associates with Failsafe, while
the tests that consume them are here executed by Surefire.

While there, tolerate targets that already adhere to Google Java Format.

See:
- https://checkstyle.sourceforge.io/releasenotes.html
- https://github.com/checkstyle/checkstyle/releases/tag/checkstyle-12.1.0
- https://github.com/checkstyle/checkstyle/releases/tag/checkstyle-12.1.1
- https://github.com/checkstyle/checkstyle/releases/tag/checkstyle-12.1.2
- https://github.com/checkstyle/checkstyle/releases/tag/checkstyle-12.2.0
- https://github.com/checkstyle/checkstyle/releases/tag/checkstyle-12.3.0
- https://github.com/checkstyle/checkstyle/releases/tag/checkstyle-12.3.1
- https://github.com/checkstyle/checkstyle/releases/tag/checkstyle-13.0.0
- https://github.com/checkstyle/checkstyle/releases/tag/checkstyle-13.1.0
- https://github.com/checkstyle/checkstyle/releases/tag/checkstyle-13.2.0
- https://github.com/checkstyle/checkstyle/releases/tag/checkstyle-13.3.0
- https://github.com/checkstyle/checkstyle/releases/tag/checkstyle-13.4.0
- https://github.com/checkstyle/checkstyle/releases/tag/checkstyle-13.4.1
- https://github.com/checkstyle/checkstyle/releases/tag/checkstyle-13.4.2
- https://github.com/checkstyle/checkstyle/releases/tag/checkstyle-13.5.0
- https://github.com/checkstyle/checkstyle/releases/tag/checkstyle-13.6.0
- https://github.com/checkstyle/checkstyle/releases/tag/checkstyle-13.7.0
- https://github.com/checkstyle/checkstyle/releases/tag/checkstyle-13.8.0
- https://github.com/checkstyle/checkstyle/releases/tag/checkstyle-13.9.0
- https://github.com/checkstyle/checkstyle/releases/tag/checkstyle-13.10.0
- https://github.com/checkstyle/checkstyle/releases/tag/checkstyle-13.11.0
- https://github.com/checkstyle/checkstyle/releases/tag/checkstyle-14.0.0
- checkstyle/checkstyle@checkstyle-12.0.1...checkstyle-14.0.0
- https://github.com/dropwizard/metrics/releases/tag/v5.0.6
- https://github.com/dropwizard/metrics/releases/tag/v5.0.7
- https://github.com/dropwizard/metrics/releases/tag/v5.0.8
- dropwizard/metrics@v5.0.5...v5.0.8
- https://github.com/prometheus/client_java/releases/tag/v1.4.2
- https://github.com/prometheus/client_java/releases/tag/v1.4.3
- https://github.com/prometheus/client_java/releases/tag/v1.5.0
- https://github.com/prometheus/client_java/releases/tag/v1.5.1
- https://github.com/prometheus/client_java/releases/tag/v1.6.0
- https://github.com/prometheus/client_java/releases/tag/v1.6.1
- https://github.com/prometheus/client_java/releases/tag/v1.7.0
- https://github.com/prometheus/client_java/releases/tag/v1.8.0
- prometheus/client_java@v1.4.1...v1.8.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants