Skip to main content

Community 1 Maven 0 Eclipse -1

Posted by jive on February 2, 2008 at 12:54 PM PST

An open source mailing list I am on recently took up the interesting debate about the Merits of Maven going on in the blogosphere. Occasionally I remember I have a blog; and most of my email is too long anyways ...

Frank Hardisty asked: For projects the size and complexity of GeoTools and GeoServer, is there currently a viable alternative to Maven?

Is there an alternative to Maven

Good question - I think the alternative would be more organization on our part:

  • less dependencies
  • and to commit the jars into svn

There are two downsides:

  • writing a lot more of our own software; and end up in a not invented here situation like many other projects.
  • at the end of the day all we would be left with is a simple build

Personally I would rather share the burden of making a build system with other projects; ant is at the same primitive level as make. Scrips are produced and copied from project to project; and after a while it gets so fragile everyone is scared to touch it.

What I like about maven is the chance to look into some coverage tools (for example), notice that they support maven, and quickly try out a few by running maven a couple of times. I have to hand it to people like Justin and Martin who have gone ahead and made a few maven plug-ins for the community; I am so glad our build is not a mess of ant scripts, and hacks that only work on linux, and ... well lets say I have worked on a smaller project that took 40 mins to build.

On a related note I am stuck maintaining a simple build that does the exact same dependency management work (since it uses GeoTools jars) - the uDig application uses an ant script to suck down jar files from the maven repository. Maintaining this is a pain and we really wish we could make use of maven.

The uDig project is stuck between two evils; something called PDE Build which makes maven look like a cake walk; and Maven (who would solve our problems except that the eclipse foundation is a big pay to play mess).

Jody

PS. My rant here ends up being pro community; rather than pro maven

PPS. A cake walk is actually an American dance tradition; with the best dancer literally "taking the cake"

PPPS. There is a couple of Java Community Process module proposals going around trying to learn from both Spring, OSGi and the maven repository system

Related Topics >>

Comments

It seems to be one thing to adopt Maven for a new project where you can simply adopt Maven's conventions. On the other hand, for an existing large project there seems to be no reasonable route to adoption. Revolution is a non starter.

It is quite possible to use maven and Eclipse together, even for RCP projects. I've done a couple myself. M2Eclipse and Q4E are far from perfect, but they do help. There is nothing special about a RCP plugin: it's a jar with some extra artifacts. So really, all it takes is a bit of maven hacking and voila! The only difficulty is that you really have to manage dependencies twice: once for Maven and once for the PDE. But even that is fixable with a little hacking

Opps I should of clarified udig is an eclipse RCP based project; as such we have two things that really want to "own" the definition of a module (and all its dependencies). Maven believes in truth, love, and one project object model. Eclipse went and got freaky with a plug-in system called OSGi (that keeps track of similar information in a MANIFIEST.MF file). Eclipse Plug-in development environment generates a java project (classpath needs and such like) based on the dependencies specified in the MANIFEST.

So what are you going to do if you would like to use maven? Well it would be great if you could generate that MANIFEST.MF file from your POM. But efforts to do so are kind of stalled. Maven likes to take a peer pressure kind of a approach (that is how more and more projects are placed into repositories). The eclipse foundation is a bit immue to this kind of treatment (as with a lot of open source the idea is to put up code and/or money, rather than complain).

Since I don't have enough time/money to solve the problem; uDig is making use of an ANT build script to pull maven dependencies down into a "lib" directory where the eclipse plug-in development facilities are can deal with it.

Basically you can only build eclipse projects from within the eclipse IDE. The PDEBuild system in an amazing hack (of ant scripts that write other ant scripts, based on the manifest files, and then call them - which turns around and calls the origional ant script). I have seen many a good man lost on the road to PDEBuild.

Ideally I would like to build an Eclipse RCP project using maven; but it has not happened ... yet.

Frank here -- my question was not meant as a putdown of Maven, but rather as an honest question. If there aren't any alternatives that would serve, then there's no need to agonize much about Maven's shortcomings. From my point of view, the things that are really compelling about Maven are things that Java lacks -- dependency management and versioning. The "convention not configuration" thing is nice too -- although there is plenty of configuration to do in a POM.



The reasons that Maven is seen as a PITA are 1. The fact that it does not work well with the leading development tool in Java (Eclipse). Even if it is Eclipse's fault, it's a big turnoff for many developers. 2. The documentation is lacking in many places. 3. bugs.



I think there is also the fact that Maven is a complex tool designed for complex projects. So it does feel a bit heavyweight. If I'm evaluating a project for possible use, and it is built in Maven, I kind of flinch, just because I know that although the project may be cool, it is probably not a quick study. This is not Maven's fault, in fact Maven makes the situation much better than it would be otherwise by firstly having a standard layout so you can find your way around the source, and secondly by listing all dependencies etc. in a standard place so you can find them. But, few of us love complexity for it's own sake.

I am a huge fan of maven and find it to be one of the most productivity-boosting developments since Spring. For large multi-module projects with intricate inter-project dependencies maven really rocks and I do not know why I would want to look for an alternative rather than to help make it even better. BTW, I did not get your comment about "(who would solve our problems except that the eclipse foundation is a big pay to play mess)". Something to do with Eclipse IDE? If so, the choice of IDE should be quite orthogonal to build / dependency system. Perhaps the problem is that IDEs like eclipse and IDEA tend to map maven build processes to their native ones. This is not desirable IMHO. I really like NetBeans support of maven via mevenide2 where the IDE simply runs the maven script. I tried using my maven projects with Eclipse and found it to be quite dismal an experience in comparison to maven and Netbeans.