Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Speed up maven build times.
# rip off from
# 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