News for hackers. Stuff that matters.
Re:Why I don’t like Maven by cletus on Thursday April 25, 2013 @10:23PM (#5611161)
Oh my God I'm sick of people equating IDEs (in the negative sense) with Eclipse. This goes beyond this post (eg typically emacs/vim users make judgments about IDEs based on having once used Eclipse). But take this statement:

> I especially find Maven unreliable in combination with eclipse.

Indeed. I have first hand experience with this. My team has a diehard Eclipse user who has added a bunch of random configuration plugins to Eclipse basically to make Eclipse work with Maven.

Compare this to IntelliJ. You can open a Maven project (even a multimodule Maven project) directly in IntelliJ. There is no project importing/conversion. It just works with the native Maven project model.

There are plenty of things to dislike about Maven but this isn't one of them.

The author is correct about Maven documentation generally being terrible. At one point I wanted to do something as simple as creating symlinks in the target directory instead of copying files. This would greatly ease doing Javascript development, for example.

Well there's a Junction plugin for Maven that alleges to do this. However it hasn't been updated since 2007 and relies on something no longer in a Maven repo that I could find.

But here's the point I most disagree with:

> Maven assumes there is one right way to build for everyone

A lot of people have this opinion (and prefer Ant, Gradle or something else as a result). I do not share this view. I like that Maven is opinionated about things like project structure.

Why? Because left to our own devices engineers are terrible at making these sorts of decisions. We all have a tendency to focus on some weird aesthetic and overstate its importance at the detriment of consistency across teams and projects.

I've had this argument with coworkers in relation to us having a very strict style guide for our code [1]. Opponents call this an obstacle getting in the way of getting something done and it has a cognitive cost of internalizing what is essentially useless information and arbitrary standards.

Obviously said people haven't worked in a large engineering organization where different teams would otherwise have different line lengths, curly brace styles, indenting levels and so on. It's a good thing there's a central set of conventions for this stuff. It avoids pointless "wars" about where curly braces should go.

I feel the same way about Maven's archetypes. Fact is, you can look at any Maven WAR project and know where to find pretty much everything. You can't say the same about any Ant project.

Just like with code style, people have an exaggerated view that their particular way of doing things is right and super-important.

Being consistent is often more important than being right.

Being right is subjective more often than it isn't.

In the end the author states:

> I think Maven works fine but in the past some logical choices have been made that do no longer make sense

which kinda makes and misses the point. He's right in that it does work fine for all its warts. But changing things like XML (for YAML or SBT's DSL or whatever) is pretty much a change for change's sake at this point.

Maven is one of many tools that isn't cool but is certainly good enough. There are really bigger things to worry about. How much time do you spend editing build files anyway?

[1]: https://code.google.com/p/google-styleguide/

Re:Why I don’t like Maven by timv on Friday April 26, 2013 @02:12AM (#5611725)
> Maven assumes there is one right way to build for everyone

A lot of people have this opinion (and prefer Ant, Gradle or something else as a result). I do not share this view. I like that Maven is opinionated about things like project structure.

Well his opinion is perfectly true - Maven does assume there is one right way to build for everyone. You're disagreeing about whether it's a bad thing.

And here's the deal - for the 95% (or more) of projects where "The Maven Way" works, it's a good thing, for all the reasons you've stated.

But not every project fits into that, and one of Maven's limitations is that once you start to push at its boundaries, it falls apart. It doesn't provide enough flexibility to be able to stretch it into places it wasn't intended to go. And so, once your project his that point you either need to fight the tool, or throw it out and use something else. Neither is particularly desirable.

Maven is one of many tools that isn't cool but is certainly good enough.

For most cases, yes, but not always. No matter who you are, your experience is not universal enough to draw those conclusions for other people's projects.

How much time do you spend editing build files anyway?

Personally? Enough to have run into all sorts of limitations in Maven.

Not everyone is working on "Maven WAR project". There are projects with full time build engineers. Even on small projects (in terms of lines of code) if the artifacts you're producing are non-standard, then you can spend days (or even weeks) wrestling with maven to get the project under control.

Maven makes the easy things trivial, the average things easy, but it also makes the hard things nearly impossible. For the 95% that's a fine trade-off, but if you're not in that group then Maven is not going to be your friend.

Re:Why I don’t like Maven by mtrimpe on Friday April 26, 2013 @03:48AM (#5611893)
Maven is very, very customizable.

I've built ETL libraries that use a completely custom lifecycle (pre-/post- extract, extract, transform & load) in Maven with a directory structure to match.

If you can't code in Java that will be hard, but it's similar to me complaining about Puppet because I can't figure out it's architecture fast enough since I don't know Ruby well enough.

P.S. Not saying you can't code in Java, but the original author did indicate the mere fact that it was Java was problematic.

Re:Why I don’t like Maven by johlrogge on Friday April 26, 2013 @12:53PM (#5613933)
Yes, the original author (me) did indicate that Java was a bad choice but not for the reasons you assume here but for the reasons I clearly stated in the post :)

Most of them being related to that Java is a compiled language so you often find yourself in a situation where you wonder about plugin internals but the actual source the plugin was built from is elsewhere. That in combination with that extensions needs to be compiled and distributed which requires infrastructure to "build the build". Sure it's easy to google and download the source, even recompile, setup a place where the plugins can be used from (custom and patched ones) but it is still extra overhead that would not be needed at all with (for instance) an interpreted language.

An interpreted language is simply a more sensible choice for these kind of things. The developers of SBT understood this and made sure the buildfile and plugins are distributed as source and compiled by SBT to make this extra step go away even if the buildfile is written in Scala.

Re:Why I don’t like Maven by mtrimpe on Saturday April 27, 2013 @05:13AM (#5617248)
Indeed. From what I can tell it seems that your post is actually taking aim at Java and it's ecosystem and how Maven embodies that more than against Maven itself.

You're framing it as an attack against just Maven though..

Re:Why I don’t like Maven by johlrogge on Friday April 26, 2013 @01:20PM (#5614111)
Wow, I don't know what hit my blog yesterday but the post has had 10000 views since then. It was an old blog so I had to read it again and I can still stand by the points I made back in 2010.

The deal with eclipse: I have certainly used eclipse and IntelliJ more than just once :) Eclipse's background incremental compile is unrivaled. Maven breaks this (at least broke this in 2010 when I wrote the post). It is the /one/ killer feature in eclipse and it is hard to be without once you get used to it /EVEN IF/ intelliJ and netbeans imports maven projects like charm. Importing projects is not the issue, it's nice to have that automated and all but the issue is that the kick ass builder in eclipse was downgraded to a below average one with the eclipse plugin. I'm sad to see that people actually think that eclipse is as bad as it with the maven stuff installed :)

IMO it's better to just generate eclipsprojects from maven and stay away from the eclipseplugins at least was in 2010. Or use another IDE if one must use maven. Unlike your die hard Eclipse-user I tend to use what others in the teams are using IDE-wise which has given me experience both with IntelliJ and Eclipse and have actually come to prefer Eclipse over IntelliJ over the years... different discussion.

There were many other points other than IDE's in the post too :) --- As someone else pointed out Maven actually does assume there is one right way to build and you're disagreeing that it's a bad thing. --- The enterprise argument is a bit of a strawman that people tend to use when others don't agree with them. I've been in small and large organizations. "Largeness" is not an important parameter other than a belief that "things are supposed to be big hard and complicated" is more common in large enterprises.

Standards are nice, I haven't had a curly brace discussion with anyone for years now (other than to make user everybodys save actions and code formatting-settings are in sync which everyone agreed so far is a good thing). I used to have those discussions a lot years ago, I think it's a maturity thing. --- You are right that declaring a POM in YAML or a DSL is pretty much a change for changes sake (as I have understood is the case in Maven 3). The real benefit would be if one would actually do something different with the language than declare a POM.

Thank you so much for the attention!

Re:Why I don’t like Maven by diek on Thursday April 25, 2013 @11:32PM (#5611340)
> My team has a diehard Eclipse user who has added a bunch of random configuration plugins to Eclipse basically to make Eclipse work with Maven.

You realize that the 'Eclipse IDE for Java Developers' comes with official support for Maven out of the box, right? I'm not a fan of Maven, but my Eclipse-related issues have been minimal.

Re:Why I don’t like Maven by jbooth on Thursday April 25, 2013 @11:37PM (#5611350)
A few years ago it was really bad, now it's super easy, file -> import maven project.
Re:Why I don’t like Maven by jontro on Friday April 26, 2013 @03:51AM (#5611898)
I can confirm this too. It even works good with war overlays now.