You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

As of Maven 3 beta 1, parallel builds are now supported in maven. The command is as follows:

mvn -T 4 clean install # Builds with 4 threads
mvn -T 1C clean install # 1 thread per cpu core
mvn -T 1.5C clean install # 1.5 thread per cpu core

This build-mode analyzes your project's dependency graph and schedules modules that can be built in parallel according to the dependency graph of your project.

There is also an additional (more experimental mode) build mode called "Weave" mode that can be activated by appending a "W" to the commands above, as in -T 1CW. This builds the reactor phase-by-phase in dependency order instead of completing the full modules before proceeding to the next module(s). Weave mode is still subject to changes.

The use of beta-versions for production systems is generally discouraged. The parallel build functionality is brand new, and although they are tested with quite a few projects they do not have the general wisdom accumulated by running on multiple project types on multiple platforms. So take care.

Plugin/Settings compatibility

The following plugins/settings are KNOWN to have incompatibilities when running any of the parallel modes:

  • Surefire with forkMode=never
  • maven-modello-plugin (fixed in svn trunk, upcoming 1.4)
  • maven-ear-plugin - all versions (only if packaging ear's in different modules)

Known issues

It is not required to report jiras for these issues:

The console output of both parallel modes is not sorted in any way, which can be a bit confusing. http://jira.codehaus.org/browse/MNG-2727

  • No labels