Jai’s Weblog – Tech, Security & Fun…

Tech, Security & Fun…

  • Jaibeer Malik

    Jaibeer Malik
  • View Jaibeer Malik's profile on LinkedIn
  • Subscribe

  • Feedburner

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 29 other followers

  • Archives

  • Categories

  • Stats

    • 379,210
  • Live Traffic

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!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: