Upgrading from Maven2 to Maven3
Posted by Jai on October 21, 2013
Nevertheless to mention that maven 3 is already out for quite some time but there are still some legacy systems using maven 2. In this post we will cover to upgrade to maven 3 for such legacy system, better late than never.
Maven 3 Features
See the maven 3 release notes for list of features.
Some of the important new features are,
- Performance improvements
- Parallel build of independent modules
- Better dependency management
Maven 3 Installation
Download latest maven 3 version from website and get started.
Check out the article for use cases, roadmap and examples.
Check the Maven 3.x Compatibility Notes while migrating from maven 2.x to maven 3.x
The upgrade procedure and issues depends on your project structure. In general scenarios it is straight forward upgrade, with minimum changes in your project poms. Cross check the profiles and versioning behavior and repository locations etc. Make sure to check the dependency management which is much strict in maven 3.
Maven Eclipse IDE integration
Integrate maven 3 with Eclipse, using Maven Eclipse plugin
Upgrade Eclipse plugin (m2eclipse, Eclipse m2e) for the same.
Maven 3 Parallel builds Usage
Check out the parallel builds functionality in Maven 3.
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
You will see the performance improvements on the first build itself. Don’t wait and just upgrade and enjoy faster and much robust build tool!