Honestly… I hate Maven

And I don’t give a damn that I don’t know it good enough. Why “good enough” in Maven is so difficult when it was so easy with Ant? I remember how we came from “make” to Ant for our projects. I remember what we tried with Ant. Sometimes we failed when we wanted too much.

And then I remember trying Maven. The Next Big Thing (was it 2005? sooner?), revolution in builds (and dependency management, and… everything, right?), and probably the next best thing after wheel. So I tried it. Maybe I was one day from our final goal, maybe just an hour. But I eventually gave up. I failed. Maybe I was just plain stupid. Or Maven too smart.

I did my best to forget about it when I was asked to provide Java Simon in some Maven repository. It was pain again. Not just to restructure our modules, but to understand that magic. And deployment. And plugins. And dependencies, tons of documentation. Maybe Maven makes complex things simpler. But Maven also makes simple things complex. And then repository of my choice changed their configuration and I decided to move on to Maven central.

Documentation again, javadoc generation (still have to figure this out), …a lot of learning for such an obvious goal. Because people want everything in Maven repository. Understandably of course. I, too, want our library to be used – Maven is our standard, our salvation.

Yes, I don’t understand Maven. I understand the concept, but I don’t understand why it has to be so complicated when one needs something very simple. Why things just don’t work. The whole infrastructure around Maven is crazy. If something isn’t right with build most of my colleagues just try to ignore the problem because they don’t want to mess with Maven. Yet we use it.

Recently I checked Gradle. It starts where Maven ended. I switched one of my older projects from Ant to Gradle. I had to do these things to do so:

  • switch structure to Maven-like POM-compliant structure.
  • call Ant’s native2ascii target (Gradle has simple facility to do that), because my project have resource bundles in ISO Latin 2.
  • and… that was it!

It was just so much more satisfying. Second step was a bit troublesome, but I was just happy when it all worked and my build file was just a few lines long. I also noticed that Gradle offers not only declarative approach, but you can say what and how you want things done when you need it. Right now I’m not doing any further research, but I know I will carry on with Gradle later when necessary.

Right now I have some Maven work to do. And I’m biased, I know it, I’m also frustrated and it all came to me – and I know that I just hate Maven. Not because it is bad – I actually don’t care. But because it’s everywhere, like a plague, it’s too complex (is parent + six sub-modules so difficult to comprehend? yes, with Maven) and you have to live with it if you want to offer anything that looks like library to other people. And worst of all you have to follow tons of additional rules when you need the stuff hosted somewhere. Maybe it’s necessary evil – but still, evil it is. There is no beauty, there is no elegance, there is just… POM. And XML, of course.


About virgo47
Java Developer by profession in the first place. Gamer and amateur musician. And father too. Naive believer in brighter future. Step by step.

16 Responses to Honestly… I hate Maven

  1. Leo says:

    I totally agree. Thanks!

  2. Pingback: More positive take on Maven « Virgo's Naive Stories

  3. Frankie says:

    I have spent the _entire_ day today wrestling maven. And last week several days. I think I understand it, or at least understand it as well as I should need to, but still it manages to fail me in mysterious ways, often without understandable error messages.
    I should add that the project is for Android, so the android-maven plugin also manages to mess things up.
    In addition, building from within eclipse does not produce the same result (success! or errors) that building from the command line does.
    I’m about thirty minutes from throwing it all out and going back to ant + checked in jars. Butt ugly (the checked in jars), but it works
    In short – I hate Maven with a vengeance

  4. Daniel Ferber says:

    We spent one month to create an over complicated .pom that convinced maven to create a zip file with all .jar dependencies and a .bat as a deploy artifact. Today m2e told me that the “standard” maven plugins that I used are not supported anymore.

    Even worse, now maven suddenly fails to recognize the .jar files it downloaded in the past. This means that the same enviroment we have been using for months to generate correct builds not fuctional anymore.

    If I would sum all time we spent fixing maven this year, it would have been less time doing all builds by hand every time.

  5. aehtiopicus says:

    i really hate this thing, in my own situation, maven compilation takes more than two hours, and is required to do this unless one time per day :S. I hate it so badly.

  6. Daniel Ferber
    My story is similar. Ended up with maven as part of a new project. I spent about a month reading docs and setting up the damn thing. But wierd dependencies kept creeping into our eventually huge dependency hirarchy. Odd non-reproducable bugs showed up.

    I hate complexity for the sake of complexity, so eventually I ditched the thing (I’m in the fortunate position of being able to do that), and I haven’t look back since.

    I can only look with pity when I see someone using maven.

  7. The only reason Gradle exists is because Maven preceded it. The concepts that Gradle builds on such as declarative builds and transitive dependency resolution started in Maven, and without the Maven repository, Gradle would have either had to create one on it’s own. Why haven’t they done that if Maven is such a bad idea? Certainly, having to create a POM to deploy one’s artifacts (whether synthetically or otherwise) is an anathema to the glory that Ivy and Gradle deserves!

    The comments here crack me up as well. Dependencies that are all messed up? An Android plugin that doesn’t work? A build that takes two hours? Are you guys kidding? Ask for your goddamn money back from the vendors! Here, I’ll do it for you! Wait for it… Did you get it? Yes, you did get that refund for $0.00, good! Happy now?

    Who do you guys think builds and maintains open source software?!? YOU DO! Cheap fucking bastards.

    And please don’t complain when the repository changes in subtle ways and your Gradle artifacts no longer work or Maven users can’t use your products because the synthetic POMs are wrong.

    • virgo47 says:

      No, Gradle exists, because Maven somehow can’t satisfy all the needs as simply as it could/should. Maven deps are no bad idea. Difficulty to do simple things beyond Maven’s vision of the world – that’s the problem. I have a simple multi-module project and when I moved from java.net repository to Maven central and started to use release plugin seriously, I had a really hard time to grasp all the stuff that was asked for me for such a simple goal. I made it after all – but only on one of my two computers. Release plugin throws exception on the other one… (same OS, same JDK, same project). But then, maybe it’s time to try again after a few months.

      There must be a reason why people complain so much more on advanced Maven than on rudimentary Ant – and release plugin is one of the “favourite” targets. That is no accident.

      Now from your comment it sounds like Gradle is the reason why some artifacts in Maven repos are broken… that is rather ridiculous generalization. Projects like Hibernate and Spring moved on from Maven to Gradle, but that’s probably mostly cheap fucking bastards develop them… or? I don’t understand that kind of language very well.

      • Distilled down, there are two takeaways intended: 1) There is no free lunch. If folks want a simple product, they are going to get simple results. The release plugin is a complex product that works with nearly a dozen different SCM providers on all properly formatted Maven builds. That’s not simple, and expecting it to work in edge cases with the ease of use of a hair dryer is unrealistic. 2) That isn’t to say that improvements could not be made to solve all conformant and valid POM XML, but instead of complaining about these changes needing to be made, get involved and at least file the issues. Nobody reads minds and nobody knows you guys are having problems unless you file the issues. Simply whinging about how “Maven sucks” in your own corner of the room is about as effective as bitching about world hunger on 4chan. Nothing is going to happen.

        The fact that there is no release plugin on Ant speaks volumes, because it is impossible, and will never be possible. Maven solved the problem of how to make such functionality possible, and if you can’t live with the constraints, again, step up and solve it better. This is what the Gradle team tried to do and just because I don’t agree with them bifurcating the community so doesn’t mean it was the wrong thing to do, it’s just my strong opinion in the matter.

        I don’t know much about Gradle other than I have run into broken metadata (lack of dependencies amongst other issues) that may no longer be an issue. Just don’t complain about Maven when it’s really the hand that feeds all these projects.

      • virgo47 says:

        No Reply button on your post, so I go here. Free lunch stuff – agreed completely. Maven is a big thing and a big step forward… under the circumstances, definitelly.

        I regularly file issues on some projects, but to do that I need to feel some passion. I absolutely agree that if someone wants a change they have to say so where it is appropriate. But to file an issue for Maven Release plugin I’d have to make more study and research which I’m simply not willing to do. There were some issues related to array index out of bounds exception already, some fixed, some can’t reproduce, etc. So I used the computer where it worked and moved on with my life.

        What I don’t agree at all is that one can’t complain about Maven. Maven got stuck on the idea that even tiny steps procedural in nature during your build/deploy requires a lot of study or effort or both. When I read why Hibernate moved to Gradle https://community.jboss.org/wiki/GradleWhy I didn’t understand many of those reasons (luckily, I’d probably have much more grey hair then) but I could agree with some of them completely.

        Gradle builds on Maven, true, but it’s not Gradle’s fault that Maven couldn’t get over itself during the last x years.

    • A Smarter Person says:

      Brian Topping = yet another monkey slinging poop at anyone who dares to say something bad about some rubbish that they feel differently about. And as usual, followed by a bunch of irrelevant nonsense plus a call for action on the part of those experiencing problems with said rubbish. I’m sure he understands the needs and requirements of all the projects others are are working on. Please.

      No. How about just using something simple that works? (Hint: If Ant doesn’t work for you, you’re probably “doing it wrong”!)

      Go sling poop somewhere filled with more Maven apologists, nobody cares what you think anyway. Yes, Maven does suck. It’s based on naive concepts, it’s unproductive, and it excels at making simple things more complicated or obfuscating problems. A great example of how NOT to do it. It’s a quest for a magic bullet that doesn’t and never will exist. The sooner people realize that and learn that simplicity always wins, the better.

  8. Kalle Karlberg says:

    Gradle happily produces the pom for you if the maven plugin is applied. And no library user will know that gradle actually was used to build the artifact(s).

    If you are a kind open source guy you also use the gradle wrapper to give the users the ability to build the source themselves with only java installed…

  9. Anonymous says:

    totally agree with you.. its taking ever for me to understand. things.. even from starting i could smell something is wrong which is making even small things entirely complicated

  10. pom says:

    pom != plain old makefile

  11. Jerry says:

    Hate hate hate maven. Why is anyone still using this?

  12. Aurodeus says:

    2018 and maven is still stupid. troubleshooting it takes longer than fixing the actual project itself.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s