-
-
Save drkarl/405dd42446e03040376b88d238692afc to your computer and use it in GitHub Desktop.
Speed up maven build times.
This file contains 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
# rip off from https://zeroturnaround.com/rebellabs/your-maven-build-is-slow-speed-it-up/ | |
# in .bashrc | |
set MAVEN_OPTS="-XX:+TieredCompilation -XX:TieredStopAtLevel=1" | |
# add -DdependencyLocationsEnabled=false to retain fewer outgoing connections. | |
# compile all modules | |
mvn -T 1C install -offline | |
# compile specific module | |
mvn -T 1C install -pl $moduleName -am -offline | |
# -T 1C: one thread per cpu core. -T 4 use 4 threads | |
# -offline: offline mode, does not check for newer snapshots. | |
# -pl $moduleName: build only specified module. | |
# -am: build depended modules (use with -pl). | |
# PS: mvn clean is not used, helps speedup as it's an incremental build. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment