SESSION

Speed Up Your Maven Build x10…Before You Move to Gradle

Gradle has a lot of performance advantages in comparison to Maven. But there are still several ways to speed up Maven builds.

Simple:

  • Upgrade hardware, upgrade JDK, use proper JDK for your arch (e.g. Apple Silicon)
  • Parallel execution, “mvn -T1C” in .mvn/maven.config
  • maven.test.skip=true (relates to get rid of test-jar dependencies)
  • Kotlin K2 compiler
  • Develocity Extension

Middle:

  • Stop deploying redundant artifacts on each build
  • Split large modules to smaller (explanation why it makes sense, comparison with Gradle)
  • Remove redundant dependencies
  • Get rid of “test-jar” dependencies
  • Extract code generation to jar dependency

Complex:

  • Get rid of AspectJ compiler (25% of compile time)

Paid:

  • Develocity with remote cache

Additional topics:

  • mvnd as way to visualize parallelization bottlenecks (alternate to Develocity or other plugins)
  • IDEA: parallel compilation
  • Eventually migrate to Gradle to have new opportunities. Some advice for Maven works for Gradle projects as well
PRESENTED BY
  • Company Logo

    Sergei Chernov

    Staff Build Engineer

Meet the Speaker