11 Juli 2013

Why I stopped using Maven

After 5 years with Maven I came to the conclusion that Maven is not very helpful with Java EE projects.

The reasons are the following:

Dependency Management of Maven is useless
With Java EE you have a target runtime (the application server). This runtime must be install anyway on every developers box for development and testing.
Now because you already have all libraries there (and in contrast to the Maven repo in the correct version) you don't need Maven to take the libraries from elsewhere. Therefore Mavens dependency management is useless. So if you use JBoss for example you can reference JBOSS_HOME which anyway points to your JBoss installation.

Now what about other libraries you may want to use in your project?
The solution is quite simple: Put them where they must be. Means in your EAR project in the lib folder or in the WEB-INF/lib folder in your WAR project! So you can put them into your version control system and you are sure everybody takes the same libraries.

Maven is not a good build tool
Ant in the past and Gradle nowadays are much more flexible and powerful build tools. They are simple and very customizable and will fit perfect what ever your build needs.


Franz van Betteraey hat gesagt…

Maven is not a good tool because the Dependency Management is useless? That can not be your conclusion after 5 years with maven!

I switched from ant to maven and I would not go back. I love the convention over configuration approach that "forces" projects to keep a standardized and meaningful layout (and as you use Java EE I suppose you love standards too).

I love the idea of using a repository for libraries (and no - I don't mind downloading the internet).

I appreciate the help of Maven in resolving transitive dependencies and detecting version conflicts.

I am glad to use build in goals instead of making every task for my own.

I am glad about the large amount of plugins - with a standardized usage and documentation.

Sure, Maven might not be the best tools for every build szenario but it works for lots of cases! Beyond that it had a great influence on the way how Java software is build and also - I think - influenced the next generation build tools (maybe gradle).

So I just want to say: Maven (and Maven people) thank you!

Simon Martinelli hat gesagt…

You didn't get the gist of my post.
I said that the dependency management is useless because I already have an application server in-place that contains all necessary libraries.

And that is the major point problem.
Who guaranties that the libraries in the public maven repos are the same as in my application server?

On the other hand I try to use as few libraries that are not part of the application server as possible. And then why should I need a repository to get them?

Franz van Betteraey hat gesagt…

Hi Simon,

you decided to highlight two statements in your post

- Dependency Management of Maven is useless

and as conclusion of your post

- Maven is not a good build tool

You might be in a situation where other tools work better but I could not let these statements uncommented. I even wonder why you work with Maven for 5 years if it is that bad! I think Maven does a good job - as tool and also as innovation. There is no need to generally mark it as a bad tool.

I even must say that I don't like these kind of posts where someone who took benefit from something for a long time period (for free) now just talks bad about it.

Don't get me wrong. I agree that Maven does not work best in all situations but a conclusion like 'Gradle works bettter for me' would have been more convincingly than 'Maven is not a good build tool'.

Kind regrads

Fridrich Müller hat gesagt…

Danke. Ich verwende ideals datenraum auch!