Skip to content

Instantly share code, notes, and snippets.

@kra3
Last active November 6, 2018 10:53
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save kra3/f42b25e032eb3ef2b172d3d7b7e1fb8a to your computer and use it in GitHub Desktop.
Save kra3/f42b25e032eb3ef2b172d3d7b7e1fb8a to your computer and use it in GitHub Desktop.
Speed up maven build times.
# 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.
# -offline: offline mode, does not checks 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