Live data from Hacker News

Maven builds are an infinite cycle of despair

kent.spillner.org

1–10 of 51 posts

Re: Maven builds are an infinite cycle of despair

#2
I'm interested if anyone at HN has good things to say about Maven. I've only scratched the surface of it, but my initial impressions have been:

* slow (even with -o to stop it downloading the internet every time)

* incredibly verbose, in both configuration and output during builds

* inflexible (but I've not really looked into plugins or advanced configuration)

* opaque and thinly documented even for basic needs

I did a fair amount with ant a few years ago and found it a much more pleasant experience. Maven seems to me stereotypical "enterprisey" software: a mediocre, moderately complex solution to an extremely complex problem.

Re: Maven builds are an infinite cycle of despair

#3
> Automatically downloading unresolved dependencies makes your build process nondeterministic!

This. You need to be able to check in your build tools, and use them as they were to precisely repeat any build you've ever done, or you're risking bit rot. Ant is sort of painful but it works for this.

And if I want my dependencies to be preinstalled rather than checked in and bundled, I'd rather use yum so the rest of the world can reuse them too. Does Maven even support dependencies upon native (non-JVM) apps and libraries which are available for a given platform?

Re: Maven builds are an infinite cycle of despair

#4

I'm interested if anyone at HN has good things to say about Maven. I've only scratched the surface of it, but my initial impressions have been: * slow (even with -o to stop it downloading the internet every time) * incredibly verbose, in both configuration and output during builds * inflexible (but I've not really looked into plugins or advanced configuration) * opaque and thinly documented even for basic needs I did…

Maven's main strength is standardization of the build combined with the dependency management that makes it easy to get a build going instantly without having to explicitly download libraries.

"slow" - can't say I've found that an issue when compared with Ant which I used to use.

"verbose" - in configuration I disagree - the more you put in your pom the less well you're using it. In output true, but I'm not sure why that's intrinsically a problem for you.

"inflexible" - absolutely not true. You can configure a plugin and Maven will go and download it for you - so as a user you can enhance the tool directly from the configuration file (e.g. I typically use a plugin to build database scripts from annotated classes).

"opaque" - yes, but there's method in that madness. It's programming by exception (how is my project different from the default?") as opposed to Ant's (mainly) explicit programming ("How exactly is this build bootstrapped?") Once you know the pro forma you can jump into any Maven project with an immediate understanding of its likely structure - very different from Ant where you basically need to read the build.xml files to know where everything lives.

"thinly documented" - Yep. The documentation is horrible and that's its biggest problem in my opinion.

Re: Maven builds are an infinite cycle of despair

#5
I am doing solo part time development (1 day/week) on a very large orphaned enterprise system. The builds are done using maven. The build takes about 15 minutes because maven is going off to various sites looking for no longer supported versions. I removed the dependencies; not much improvement. I tried mvn -o and the build dropped to 3 minutes. But war file was broken in mysterious ways. The currently irreducible step is 6 minutes to make a war out of a half-dozen project wars. So tossing maven is an urgent item on my plate.

The attractive part of maven is that it manages all the version dependencies for a large development team. For a solo developer it is way too much pain.

Re: Maven builds are an infinite cycle of despair

#6

I'm interested if anyone at HN has good things to say about Maven. I've only scratched the surface of it, but my initial impressions have been: * slow (even with -o to stop it downloading the internet every time) * incredibly verbose, in both configuration and output during builds * inflexible (but I've not really looked into plugins or advanced configuration) * opaque and thinly documented even for basic needs I did…

I've found maven to be useful.

It standardizes the layout for the majority of java based projects.

It also lets me deal with dependencies in a decent manner. Maven should not be downloading dependencies on every build unless you are using SNAPSHOT versions.

There is a free book available: http://www.sonatype.com/products/maven/documentation/book-de...

Re: Maven builds are an infinite cycle of despair

#7
I've had a go at Maven a few times, hoping to make it work but I always run into the same issues:

1. It is very difficult to configure a hermetic Maven build that doesn't rely on external resources. There are third-party repository managers, but none of them worked well enough to replace the 'dependencies in SVN' model.

2. Maven artifacts were often far out of date. RedHat has its own Hibernate-focused repository now, but this wasn't always the case. I'd find myself trying to get the latest version of dbcp or another commons project to get a bugfix and finding that it wasn't packaged.

3. Support for multiple source-based projects that depend on each other felt bolted on. I can't remember the details, but you couldn't build more than one project from source without specifying a link to a parent project from each child project, which then referenced each of its children.

I've written and rewritten countless build systems (from batch files last millenium to Ant/NAnt/MSBuild) and they always end up being simple wrappers over javac/junit that manage transitive dependencies and build cycle ordering. The tricky part is ensuring that your IDE's dependencies match those in your build system.

I recommend Ivy as an alternative to straight Ant or Maven that does dependencies and ordering well, but doesn't require you to buy in to any special build philosophy: http://ant.apache.org/ivy/

Quick addendum: Ivy has its own quirks and is far too complex under the hood for my taste, but does the job well if you stick to straight dependency management. If you can avoid using anything on top of pure Ant scripts to build your project it'll make your life way easier.

Re: Maven builds are an infinite cycle of despair

#8
Yes, Maven sucks, but for large projects the dependency management is rather nice. Java as a language is terribly dependency crazy, and being able to add three lines to your pom and get a new library in along with all its dependencies is a good thing. Though I'll now get flamed for not fully understanding every library dependency I'm importing in, which is fair, but hasn't been an issue for me for the three years I've been using Maven on various projects.

But that said, Maven has a build tool absolutely fucking sucks.. I much much prefer ant, and totally agree that mvn can be completely retarded and suck away a half day randomly.

If there was an ant alternative to deal with the library dependency problem then I'd be all for it. It seems that now that ibiblio exists, there should be ample opportunity to do this, basically rewrite mvn but use the existing repos.

But really, this single command makes mvn worth the trouble for me: % mvn -DdownloadSources=true -DdownloadJavadocs=true eclipse::eclipse

Give me another tool that does the same thing by me just specifying all my direct dependencies and version numbers and we can talk.

-Nic

Re: Maven builds are an infinite cycle of despair

#9
Maven sucks, yes. But, right now, Maven is the best solution for Java projects. This is why:

If you use it right you end up with 1 source of truth for your build. Most Java IDEs support maven as a project model, and therefore you don't have to maintain two separate builds: one for the IDE and one for the build system--something that always leads to integration pain.

Ant as a tool isn't capable of this, since it doesn't really represent an project object model. Certainly IDEs can invoke Ant targets, but their non-standard nature make tight integration with the IDE hard, if not impossible.

There are several things that Maven could do to make the experience better. I suspect many of them will be addressed in 3.0; however, Maven as an experience has always sucked and I suspect will always suck. The broad based acceptance of the tool will give it a certain inertia that is likely going to be hard to overcome.

Re: Maven builds are an infinite cycle of despair

#10

Yes, Maven sucks, but for large projects the dependency management is rather nice. Java as a language is terribly dependency crazy, and being able to add three lines to your pom and get a new library in along with all its dependencies is a good thing. Though I'll now get flamed for not fully understanding every library dependency I'm importing in, which is fair, but hasn't been an issue for me for the three years I'v…

There are at least two:

1) The Maven Ant tasks: http://maven.apache.org/ant-tasks/index.html 2) Ivy (now part of the Ant project): http://ant.apache.org/ivy/

We use Ant+Ivy, and although it has some quirks Ivy works well enough for dependencies.

Post reply on HN