Apache Maven

Maven (http://maven.apache.org) is a Java based project build, test, documentation, deployment framework which among other things builds on (re)using tasks for ApacheAnt.

There is a wiki (http://maven-plugins.sf.net/cgi-bin/wiki) completely devoted to all things related to Maven, but with special focus on MavenPlugins?.

The big idea is that Maven will provide you with plug-ins for doing all the most common tasks (such as running UnitTests, generating JavaDoc, building Web sites, etc) and all you have to do is re-structure your project around Maven.

Is it me or is this tool insanely complicated? It basically tries to subsume everything you can do with Ant, attempts to track the projects you depend on (think Debian-style dependency tracking) and adds a layer of XML-based scripting using Jelly. It seems to have become the standard for various Jakarta projects even though it's not at 1.0 yet. In terms of complexity it's like Emacs but without the documentation. No, it's not just you.

Is Maven too complicated? My impression: If nothing else, it is a time-sink. The main advantage is that it sticks version numbers on jar files. Thus, instead of myproject.jar, you have myproject-1.0.jar. When you initially set up a project, this lets Maven automatically download the right jars for your project. That's about it. Almost everything else seems tailored to managers who like that "I am operating at a higher level than everyone else" feeling. Umm, I mean: Maven allows endless configuration and tweaking and re-arranging that does essentially nothing. "Ooh, I've spent that last 3 weeks re-orging the projects so that _this_ parent project allows all the others to default to hibernate-3.0.jar." ... There are side-effects that are pure negative: Maven encourages a strong separation of projects, and this amounts to having in 10 places what could go in 1 place. Thus, the build process (which an IDE could normally handle transparently) suddenly takes 2-3 minutes. That can slow you down by a factor of 100x, in some cases. It encourages an "architectural" point of view, rather than a "results" point of view. I would estimate that my company spends 500 hours a year dinking around with Maven. Advantage: It gives project managers something to do.

Has anyone tried out CentiPede instead? Does that do a better job of leveraging/reusing existing knowledge about Ant?

An insightful review of Maven was available at: http://www.patrickpeak.com/page/patrick/20030428


Having carried out a micro-evaluation of Maven compared to our existing Ant build systems I would say it has the following advantages:

My experience is that Ant is a great tool, but once you have ten projects with ten build files all coded at different times and by different people, a tool like Maven, where it appears that you can enforce some standards to your builds, appears mighty attractive.

And let's add some disadvantages....

Ant has it's troubles, being a low-level tool, but Maven is not a good answer to those. (The fact that so many Apache projects adopted it makes me worry that Apache has degenerated into a mutual admiration society.)


  mvn archetype:create -DgroupId?=com.mycompany.app -DartifactId?=my-webapp -DarchetypeArtifactId?=maven-archetype-webapp

[INFO] Error building POM (may not be this project's POM).

Project ID: org.apache.maven:maven-profile

Reason: Error getting POM for 'org.apache.maven:maven-profile' from the repository: Error transferring file

  org.apache.maven:maven-profile:pom:2.0

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  apache.snapshots (http://svn.apache.org/maven-snapshot-repository)


One nice feature of Maven is its library management; it is very good at pulling down required versions of dependency JAR files from public repositories, eliminating a lot of the manual set-up of other build processes. It is unfortunate that click-through licenses prevent most of the Sun JAR files to be downloaded in this manner.

(If nice means not being able to build because Maven wanted to get something, for example part of itself, and the repository is down. Periodically downloading some of your own dependencies is not a terribly onerous activity, and if you're doing your job well, the diligence you apply to moving to new versions of libraries you depend upon requires more time and energy than the mere act of downloading. This aspect of Maven is of dubious merit, and the implementation is a nightmare.)


CategorySoftwareTool


EditText of this page (last edited June 7, 2007) or FindPage with title or text search