Live data from Hacker News

Why Everyone Eventually Hates or Leaves Maven

nealford.com

31–40 of 168 posts

Re: Why Everyone Eventually Hates or Leaves Maven

#31
I've worked on two build systems (and used many more). The conclusion I have arrived at is you don't want a declarative-only system (like Ant). They can be convenient but as your needs grow more complex they start becoming a hindrance.

Instead, you want general purpose language that builds the build dag using the build system as a library. This gets you control and customisability for free, and you can still get reuse through code libraries.

Re: Why Everyone Eventually Hates or Leaves Maven

#33
post #3

I don't hate Maven, and I haven't left it yet. But he is absolutely correct about the key observation: a basic tool with "plugins" is simply NOT the way to create a build tool. A built tool should allow (when needed) the full flexibility of a Turing complete programming language. Because eventually your project is probably going to need it.

So...the way that you do that in Maven is to create a plugin, which is very easy to do. There's your full flexibility, as soon as you want it. Your plugin has to play by the rules, which is a good thing. Maven's useful for more than the beginning of a project. If you're working on real-world software, you're probably not the only person who has to understand your bespoke build, if that's the way that you've chosen to…

The problem is that there is a large overhead associated with writing a plugin. Sometimes the things you need to do are as small as copying a file from one directory or another. Having to write a plugin to do something so small is overkill.

Re: Why Everyone Eventually Hates or Leaves Maven

#34

I'll take rigid maven any day. Much preferable to some cobbled together build system that is undocumented and hard to reliably reproduce. I'm curious what people are doing with Maven that they manage to get into such a fight with it? Although to be fair, due to issues in its dependency resolution mechanics, it can pull in incorrectly versioned artifacts without ever telling you anything.

There are more options besides a completely rigid build system and cobbled together build system. There is room for something in between. I think the build tool should encourage you to use common structure but allow you deviate from that if necessary. Sometimes, Maven makes it very difficult to accomplish small tasks without writing an entire plugin.

Re: Why Everyone Eventually Hates or Leaves Maven

#36
post #23

I totally agree with the article. I love somethings about maven but XML is a pain to work on. I am thinking that a build system can be built on top of Java. But Java for shell scripting has some drawbacks that can be alleviated. I am working on these little tool to use regular java for shell scripting, it is auto compilable and it has better abstractions for file manipulation. https://github.com/huherto/jashi

Hum? Groovy?

Re: Why Everyone Eventually Hates or Leaves Maven

#37

I'll take rigid maven any day. Much preferable to some cobbled together build system that is undocumented and hard to reliably reproduce. I'm curious what people are doing with Maven that they manage to get into such a fight with it? Although to be fair, due to issues in its dependency resolution mechanics, it can pull in incorrectly versioned artifacts without ever telling you anything.

I've never understood the hate for it either. It's a relatively thin wrapper around Javac for defining your dependencies and implementing a standard compile, package, test, deploy lifecycle. In the bad old days you would just half-implement the same thing in an ad-hoc way.

It certainly isn't easy to get running if you don't use t regularly. I only have bad passing reasons to use maven, and every time it has been a huge timesink just to get it to spit out a jar file.

Not a fan.

Re: Why Everyone Eventually Hates or Leaves Maven

#38
post #3

I don't hate Maven, and I haven't left it yet. But he is absolutely correct about the key observation: a basic tool with "plugins" is simply NOT the way to create a build tool. A built tool should allow (when needed) the full flexibility of a Turing complete programming language. Because eventually your project is probably going to need it.

A built tool should allow (when needed) the full flexibility of a Turing complete programming language. Because eventually your project is probably going to need it. I've never seen a situation like this - but perhaps I've lived a sheltered life. Can anyone give me an example of when this would be a good design decision?

You're generating configuration files from a database as part of your build.

OR

You're reading a file and using the details in that file to control your build.

OR

You need to loop through a set of properties and apply a specific update to each value before the build.

OR

You need to invoke complex build logic based on the platform you're building for (nested ifs).

etc.

There are lots of odd situations you end up in with real projects.

The flexibility this provides comes at the cost of build complexity though.

Obscure syntax and odd custom DSL's (>_> cmake, make, powershell) are bad because they introduce complexity and destroy the readability and maintainability of the build.

You basically need a test suite for your build code to make sure it's building correctly. Terrible.

...but, necessary. I'm not a java guy, but writing C and C++? You need to do this stuff all of the time. scons or cmake really make life a lot easier than trying to force Makefiles to do things with their obscure lambda syntax.

Re: Why Everyone Eventually Hates or Leaves Maven

#40
What are the biggest differences between Rake, Gradle, and Leiningen? All 3 allow their respective language (i.e. Ruby, Groovy, Clojure) to be used within the build script, but besides the pros/cons and popularity of those languages, what are the differences between the build tools themselves?
Post reply on HN