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

Compare with Current View Page History

« Previous Version 6 Next »

As of Maven 3 beta 1, parallel builds are now added as an experimental feature 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). Your expected performance gain can vary quite dramatically according to your project structure/build architecture, and weave mode may not always be faster than regular parallel. 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 functionality within the Maven3 core is thread safe and well behaved, but the maven ecosystem consists of a large number of subsystems, and a lot of plugins have a large number of dependencies. Not all of these plugins/libraries were written with thread safety in mind.

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

There is a bug in plexus io that causes all the jar/war/ear plugins to intermittently fail with output on the form "Failed to retrieve numeric file attributes using: '/bin/sh -c "ls -1nlaR <a path>" (Maybe linux issue only; might be related to http://jira.codehaus.org/browse/PLXCOMP-122 )

  • No labels