maven ant and the repeatability of releases

Fri, Dec 21, 2007

As part of the Guanxi migration to Spring, I took the opportunity to split the Service Provider into separate Engine and Guard projects, mainly to allow release of either without having to affect the other component. The Guard currently has Java (standard servlet filter, Struts RequestProcessor and Spring HandlerInterceptor) and PHP implementations, while the Engine is constant, in that it is a standalone identity.

I also ported the Engine build to Maven2 but this meant porting the Guanxi::Common and Guanxi::Core modules to Maven2 as well as they are dependencies and I thought I might as well port them as it gives me examples of Maven2 build types:

  • jar for Guanxi::Common
  • war for Guanxi::SP::Engine
  • xmlbeans for Guanxi::Core
Previously all the builds were in Ant. So what do I think of Maven2? Well, you can do a search for maven on this blog to find out that I don’t particularly like it. It’s forever downloading the internet and even if it finds what it’s looking for in one repository, it will still search all the repositories you’ve defined in your root POM. On top of that, I just don’t like having to type too much and maven is deaf. Why do you have to type xmlbeans:xmlbeans? Are there no defaults in maven plugins? Or should that be plugins:plugins?

I’ve also come across the problem of repeatability of releases described in the Fishbowl article. With maven, you’re at the mercy of the internet. You cannot guarantee that you can repeat a particular release of your software as the jars you require are held in public repositories with no SLA and no guarantee of being around in 5 years time. Even if they are, you can’t be sure to find the jars you need. The naming convention is bizarre. Take for example, XMLBeans. I need xbean.jar and jsr173_1.0_api.jar. I would expect to find xbean.jar in a maven2 repo under:

org/apache/xmlbeans/xbean-x.x.x.jar

but instead, it’s in:

xmlbeans/xmlbeans/xbean/xbean-x.x.x.jar

no sign of jsr173_1.0_api.jar so I look in:

xmlbeans/xmlbeans

and find an xmlbeans-x.x.x.jar

what’s that all about? What is xmlbeans.jar? and where is jsr173_1.0_api.jar? In the end I just added xbean.jar and jsr173_1.0_api.jar to my own repository. So the public maven environment failed to provide the necessary build functionality in this case. It also highlights another problem you have. You have to search public repos like ibiblio to find the path to the jars you need. So there’s a lot of surfing involved before you can even write your POM.

I’ve ported some of the Guanxi build to maven but I’m not sure whether I’ll stick with it. I can’t see a way to add manifest information to the generated Guanxi jars. I can do that in Ant very easily. There’s prolly a way to do it with maven but I haven’t found it yet. I suspect that I’ll stick with Ant as I want the repeatability of releases Some users of Guanxi might not update for years so I’ll need the ability to roll back to a particular release, verbatim. With maven, I’m not sure I can do that.

comments powered by Disqus