Live data from Hacker News

Maven builds are an infinite cycle of despair

kent.spillner.org

11–20 of 51 posts

Re: Maven builds are an infinite cycle of despair

#11
post #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.

Do either one of those actually pull down the appropriate sources and javadocs, and update my Eclipse classpath to include them with one command? I'm actually asking, not being snarky, as it doesn't look built in with Ivy and the few little projects claiming to do it don't look very active, what has been your experience?

As I said, that is the one big carrot still keeping me in mvn camp.

Re: Maven builds are an infinite cycle of despair

#12

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…

http://quokka.ws/

Re: Maven builds are an infinite cycle of despair

#13

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…

Yes, Maven is a great tool in my opinion. With automatic dependency management and IDE integration it makes my life so much easier.

When I'm justifying including a third party (open source) library I ignore those that are not build with Maven and whose artifacts are not installed in the central repository.

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

At least you don't have to download everything manually, which is far, far more tedious. I'd rather let it to the tool to download dependencies.

* incredibly verbose, in both configuration and output during builds

I bet the simplest pom file will be shorter than the equal ant build script. And I personally don't care about output verbosity.

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

You can easily extend maven builds with ant scripts, which makes Maven as flexible as Ant.

*opaque and thinly documented even for basic needs

That may be the real issue.

Re: Maven builds are an infinite cycle of despair

#14
post #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 st…

I am doing solo part time development on a medium size personal project which uses Maven as it's build system. It works just well for me, I have nothing bad to say about it.

Re: Maven builds are an infinite cycle of despair

#15
post #10

Earlier quoted context omitted.

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.

Do either one of those actually pull down the appropriate sources and javadocs, and update my Eclipse classpath to include them with one command? I'm actually asking, not being snarky, as it doesn't look built in with Ivy and the few little projects claiming to do it don't look very active, what has been your experience? As I said, that is the one big carrot still keeping me in mvn camp.

I've worked with ivy on a project a few years ago and the integration with eclipse worked fine for the classpath and sources. I didn't check about the javadocs.

Ivy is mainly a tool to work with ant, so it makes some sense that IDE integration is not in the same project, but as far as I could see, ivy and the eclipse plugin are written by the same people.

The eclipse plugin was actually one of the reasons for choosing ivy over maven, because at the time maven was moving to 2.0 and its eclipse plugin was not yet available or stable. The other reason was the documentation. At the time there seemed to be more documentation about ivy than about all functionalities of maven together.

Re: Maven builds are an infinite cycle of despair

#16
The primary advantage of maven is that it gives a common structure to a project and it's dependencies. When working with multiple development teams, it gets very difficult to comprehend different projects when:

Project A has the source in /java/src Project B has the source in /main/src/java Project C has the source split in two different dirs: /src/test/java /src/main/java

worse yet, compile targets are called: project A -> compile project B -> build (note, the build target in project A will deploy the software to a stage server... good luck the first time you accidentally figure that out) project C -> go

and to maintain the version number of your package: Project A uses a file called /resources/projectA.properties with a key of "verno" Project B uses a file called /main/project.version Project C uses a property set in /build/build.properties

Maven, when used in a way to avoid the above mentioned problems, will typically have the source code structured the same way for every project.

Yes, it's java-centric yes, configuration can be a mess yes, documentation is redunkuluously poor

But it sure beats wracking your brain trying to figure out how to build a project when every new developer does it a different way.

PS. I've never experienced any of the performance/download problems other folks have mentioned. I think they might be doing something wrong.

Re: Maven builds are an infinite cycle of despair

#17
Seems like the typical reaction seen over and over. People love to hate maven. It always goes like this:

1) try maven but don't bother to RTFM 2) run away with your hair on fire and back to cave-man tools like Make, Rake & Ant 3) ignore dependency management 4) re-invent the build script for _EVERY_ project you start. 5) ??? 6) profit!!!

You only ever hear rants like this from people who don't spend the time to learn maven. It's not that hard. This is just rants.

Re: Maven builds are an infinite cycle of despair

#18

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…

Another maven user here.. and Ill tell you why its better than ant. Yes the convention over configuration is the reason. I can look at project structure, and know exactly where to find everything download dependencies and be up and productive in little time. Working at several different companies, with ant, you will find that different structures, trying to figure out where to get dependencies.. etc. Higher cost to start 2. The dependency issue the author is talking about( and seems like his main issue) is false. You should have a dedicated private repository like archiva, and you will never have issues. Just like large projects have a build manager, you should be managing dependencies yourself. 3. Very configurable, there are plenty of plugins, and you can write your own. 4. verbose ?? obviously you haven't see some major ant scripts. But yes it can get large in a single large project but the design convention would be to have a common pom, and break your project into modules.

Re: Maven builds are an infinite cycle of despair

#20
Maven sucks and everyone hates it, but uses it anyway because tragically there is no better alternative for large projects.

For me, the M2 plugin for Eclipse seals the deal as it makes the build files double as the IDE project files. One place for dependencies, one build cycle, this is how things should be.

I hate Maven with a passion, and use Ant any chance I get, but for very large multi-module projects, the strong points outweigh the negatives (although by an uncomfortably slim margin).

Post reply on HN