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
View the slides Arrow Down
PRESENTED BY
  • Company Logo

    Sergei Chernov

    Staff Build Engineer @ Adyen

Watch Video

Watch the video Play Button

View the slides Arrow Down
Develocity Highlights

Take it further with Develocity

Sergei emphasizes the importance of optimizing Maven builds through a variety of techniques, but in particular he highlights the importance of build caching. The Develocity Maven Extention can significantly speed up Maven build times by not only providing advanced build caching, but also by offering deep performance insights using the data collected by Build Scan. The acceleration benefits of build caching alongside data that helps you rapidly identify cache misses and other performance regressions can significantly improve developer productivity.

Learn more Arrow Right

The slides

Meet the speaker