Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven 3.0.5 vs 3.1.1 vs 3.2.1

Tags:

java

maven

Today I've visited official Maven website and was surprised to see 3 versions listed there: 3.0.5, 3.1.1, and 3.2.1

I am currently using 3.0.5, and would like to know if I should upgrade to a newer version.

Unfortunately, there is not a single word on the website about what is different between versions, and whether it is recommended to upgrade, and if upgrade to what version.

Can anyone point to the relevant resources?

like image 782
Alexander Pogrebnyak Avatar asked Feb 27 '14 16:02

Alexander Pogrebnyak


2 Answers

Since Codehaus shut down in April 2015, some of the links in the historical release notes (e.g. in 3.2.1) are broken. You can browse them at:

https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12316922

One important point for consideration: upgrading Maven will upgrade the default version of core plugins. And almost everything interesting about Maven is done in the plugins (hence why you won't find many Earth shattering changes in the release notes of Maven itself).

If you are relying on default plugin versions, you need to look at the plugin release notes as well as just the maven version. The release notes for 3.2.1 don't include the changes that come along with Wagon 2.6, for example.

I suggest not to rely on maven's plugin version defaults as it is too easy for colleagues to use slightly different Maven versions leading to inconsistent builds due to plugin differences.

If you're not doing so already, I suggest to explicitly specify your maven version in your pom; e.g.:

<prerequisites>
    <maven>3.0.5</maven>
</prerequisites>

Then add a dependency on versions-maven-plugin and run

mvn versions:display-plugin-updates.

This will give you a list of all the updates available to plugins for your version of maven. Google to find out if there are any changes of interest. Of course you can choose to upgrade only some plugins, but regardless specify all your plugin dependencies explicitly.

like image 87
drrob Avatar answered Nov 19 '22 23:11

drrob


There are two key things to know for software developer using Maven:

  1. Maven 3.0.5 is just a security fix for maven 3.0.4 and nothing more. This version is fully compatible with what you had before. So if you have <=3.0.4 then 3.0.5 is the easiest way to go.
  2. Some maven plugins may fail to work properly with Maven 3.1.x or 3.2.x. This happened to "flyway" for instance (which we use on our project). And I've seen some reports of other plugins failing as well. So if you can do a quick-switch, test, and nothing goes wrong, I guess you are okay with the latest version.

In other aspects 3.1.x and 3.2.x are just an evolution of maven. Releases 3.1.x and 3.2.x introduce more changes to internal maven mechanics than to user experience. They are now using SLF4J internally, changed some libraries implementations, some CDI mechanisms.... However some user-friendly features are there as well. Like "version ranges" support.

All in all.... I'm starting to think toward gradle :)

like image 5
Platon Avatar answered Nov 19 '22 23:11

Platon