Tuesday, September 22, 2009

Maven 3 early access

After the talk from Jason van Zyl, I thought it was time to give Maven 3 a try. So I checked out the sources from svn and tried to build. That was the first challenge because even though Jason told us they switched from Plexus to Guice there is still a dependency on plexus 1.2.1-SNAPSHOT. I could not find any binaries for this so I checked that one out and built that too.

So now I can build and run Maven 3. In the presentation from Jason he told us that they didn't want to change too much because they didn't want to break backwards compatibility. They did a lot of tests to fulfil that promise by checking out Maven 2 open source projects and testing them with maven 3. They even have a Hudson grid running multiple builds to ensure backwards compatibility. So I thought that my project will work without any problem. I never do anything exotic in my builds, but how wrong could I have been, because it does not build with Maven 3. It gives the following error that was very clear:


[ERROR] Some problems were encountered while processing the POMs: [ERROR] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: xml-resolver:xml-resolver:jar -> null vs null @ ch.admin.smclient:smclient:1.0.1-SNAPSHOT, /home/edewit/workspace/smclient/smclient/pom.xml

So what I never noticed before is that I had the xml-resolver twice in my dependency list. Once with a version number and one without. Maven 2 never warned me about this. This shows that the dependency management resolving has improved a lot. Also the way the errors are presented is improved I think.

Also Jason mentioned that the speed of Maven 3 has improved, so I tested this as well and it turns out that on my project the speed increase was about 11%. That is not great but it's not bad as well.

Jason said that everything they are working on (Maven 3, m2eclipse and Nexus) is going to be finalized at the end of this year. So I'll be looking forward to that even though I think this version of maven is already a step forward. After more projects successfully built with Maven 3 I'm sure that they intend to add more new features.

No comments: