Skip to content

Speed up mvn clean install with parallel builds and forked test execution#5795

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/optimize-mvn-build-speed
Draft

Speed up mvn clean install with parallel builds and forked test execution#5795
Copilot wants to merge 2 commits intomasterfrom
copilot/optimize-mvn-build-speed

Conversation

Copy link
Contributor

Copilot AI commented Feb 13, 2026

Build runs single-threaded by default — both module builds and test execution. With ~400 test files in api alone, this leaves most cores idle.

  • Parallel module builds.mvn/maven.config with -T 1C (one thread per core). Independent modules (bom, tools, test, liquibase) build concurrently.
  • Parallel test executionforkCount=1C + reuseForks=true on maven-surefire-plugin. Distributes test classes across one forked JVM per core.

Each surefire fork is a separate JVM process, so H2 mem: databases, Spring contexts, and static state are fully isolated — no test changes needed.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • mavenrepo.openmrs.org
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -classpath /home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/boot/plexus-classworlds-2.8.0.jar -Dclassworlds.conf=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/bin/m2.conf -Dmaven.home=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1 -Dlibrary.jansi.path=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/openmrs-core/openmrs-core org.codehaus.plexus.classworlds.launcher.Launcher validate -pl api -q (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -classpath /home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/boot/plexus-classworlds-2.8.0.jar -Dclassworlds.conf=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/bin/m2.conf -Dmaven.home=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1 -Dlibrary.jansi.path=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/openmrs-core/openmrs-core org.codehaus.plexus.classworlds.launcher.Launcher help:effective-pom -pl api -Doutput=/tmp/effective-pom.xml -q (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -classpath /home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/boot/plexus-classworlds-2.8.0.jar -Dclassworlds.conf=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/bin/m2.conf -Dmaven.home=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1 -Dlibrary.jansi.path=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/openmrs-core/openmrs-core org.codehaus.plexus.classworlds.launcher.Launcher validate -pl api --also-make --no-transfer-progress -q (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…ution

- Add .mvn/maven.config with -T 1C for parallel module builds
- Configure surefire forkCount=1C and reuseForks=true for parallel test execution

Co-authored-by: dkayiwa <1390773+dkayiwa@users.noreply.github.com>
@sonarqubecloud
Copy link

Copilot AI changed the title [WIP] Improve build speed for mvn clean install Speed up mvn clean install with parallel builds and forked test execution Feb 13, 2026
Copilot AI requested a review from dkayiwa February 13, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments