aspects of maven

Maven, you can't live with it but you can't shoot it either.

Maven the build virus. It does not want to be one of the tools it wants to be the only tool. But I do have a build system already
(Elephants). I stated in the docs that I looked at maven and found it lacking, which is still true. But it does have some features I like.
So I started to morph Elephants so that I can use same parts of maven.
But first things first:

the good parts of maven (highly subjective)

  • Source layout

Java has some but not many conventions how to layout source code. Maven on the other hand has a mostly clear idea how to do it and
is becoming the de facto standard. If you are new to a project and it is mavenized you know where to look.
Now changing Elephants and fausterize to use it is simple.

  • Tool: check new versions

Check the net whether a library has a new version: mvn versions:display-dependency-updates.
Of course this does not work for manually added libraries.

  • Tool: sonar

Sonar is a 'quality management platform', i.e. a aggregator for many quality metrics. To check your mavenized project:
download and start sonar, execute mvn install sonar:sonar, open http://localhost:9000.

Be warned if your project is not structured as a standard maven project the setup might be more complicated.

the bad parts of maven and how to circumvent them

  • XML

So ugly only a mother could love it. No seriously why would anybody want to write XML. This thing is data format, good for exchange and computers but humans have other things to do. Programing languages are somewhere in the middle. Add a nice IDE telling you what methods are available which syntax makes sense and then we talk. In other words don't write XML generate it. (coming soon 'artig')

  • Download the world, uncontrolled

Maven needs to download stuff from the net, repeatedly. The only way around this is a private repository, e.g. a directory checked into source control.
In may case that would mean 40MB where about 37MB are just for maven, no thanxs. The second best is to mix, i.e. a private checked in repository checked into source control with just the stuff you need to build the project without maven. If you can run the build with an other tool (Elephants) you have everything you need and control over it. But that means … see next point.

  • Repository Structure and foreign jars

When maven wants a jar it has to be in a repository at a specific place. That means your directory holding all jars must be formatted the way maven likes it. If you want to use a jar maven does not know you have to create a pom and add it at the maven-right place.

  • Documentation and Error Messages

To write a correct pom you have to spend time with google. After some time you may know the right tricks. If something goes wrong the error message will be buried in tons of noisy info messages. My goal is to move the pom writing to pom generation. Hopefully that also reduces the need to search error messages in maven output

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License