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.

Friday, September 18, 2009

Thoughts on Jason van Zyl talking about Maven 3

Today I've been to the talk from Jason van Zyl hosted by the JUGS (Java User Group Switzerland, yes I know it's a ridiculous name). He is one of the authors of Maven 1 and 2, he talked about Maven 3 and what it's going to bring us. And I must say it's quite impressive. Being an open source contributor myself I know that good software is written in 3 times. This was also the main point of his talk. He first made the joke that he never expected us to use Maven 1 but that Maven 2 was useable, and now they are fixing everything in Maven 3. I now use Netbeans because I love the Maven support that it's got. But with Maven 3 they are also developing the m2eclipse plugin. And what Jason told us during his presentation is that also here they are fixing a lot of things there. For instance Maven will have a query-able life cycle, with this eclipse can use only a part of Maven for instance to do a compile. So no longer adding a resource will kickoff an entire maven build and 5 minutes later we are ready to code again. I still think that the editor of Eclipse is better than the one Netbeans provides and Jason also says that the Maven integration was better in Netbeans. In fact they've used a lot of the Netbeans plugin features in the new m2eclipse plugin. Knowing all this I must really give Eclipse another try. What the new maven 3 also will have is a way to describe your maven model how you would like it, so for instance you could use ruby or groovy to create you're maven object model, instead of a xml, we could do something with this just don't know what. One thing I'm really excited about is they are making the maven integration also communicate with other plugins. For instance when you make changes in the WTP plugin about your war, this will also be put in you're pom. The same holds true for PMD plugin, the settings that are in your pom will also be set in the PMD plugin and changes made will reflect back.

Jason is quite a talker, his slides were full with text and he only briefly stopped talking to take a zip of water. His company also makes Nexus a proxy for maven repositories. Other products that do something similar are Artifactory or Archiva. The cool things they've build into Nexus is the ability to also be a proxy for Eclipse plugins. But all the cool things about Nexus are in the commercial version of Nexus like for instance LDAP authentication and lots of features around provisioning repositories.

Talking about their commercial products, they also sell this concept where one can have everything setup for a developer in one go. The m2eclipse plugin will discover where Nexus is, install the necessary plugins, show the projects a developer can work on and even download wiki documentation from confluence or twiki. This can all be configured by the technical lead of the project. I really like this concept, to many times I've seen it take days for a new developer to be up to speed. Not only taking time on his one, but also needing intensive support. With this in place some of that time can be saved.

So all in all I'm very positive about this presentation, JUGS keep up the good work. And I'll be trying the dev build of maven 3 and m2eclipse right away tomorrow. I'll let you know how it works out.