Hacker News new | past | comments | ask | show | jobs | submit login

Ant makes my life easier.

It is true that more steps have to be done "manually," but the build is 10x more deterministic than Maven. For example, think about this:

With Maven I spend two months developing $APP on my machine. Maven does its magic dependency downloading at time t0. Then someone else starts hacking on $APP at time t1 on their machine, and as the first step, they do the magic dependency downloading and it breaks. Why does it break? Different configuration? Different OS? One of the 100 servers for the app's 100 dependencies broke? An incompatible change introduced in one of the 100 dependencies during an interval of t1-t0 = 2 months? Different version of one of the 100 dependencies?

At least Ant builds are deterministic. Maven builds depend on remote Internet resources remaining the same over time. Spoiler: They don't. Libraries are updated all the time. Often the changes are incompatible (sometimes intentionally, sometimes not). URL's become dead as businesses and organizations change their file structure, change CMS'es, change domain names, merge, go out of business.

With Maven, I'll admit that when things work, they're easier. But when they break, there's so much automagic going on -- including the contents of remote servers you don't control -- that it's tough to know where to begin finding the problem. Whereas with Ant, it's fairly easy to understand exactly what's going on, and you have a good chance of fixing it.

I'm sure most HN readers know exactly how frequently build systems of all stripes break, and how important it is to quickly troubleshoot build issues so you can get back to work that actually creates some sort of value :)




Well, technically, it's good form to run with your own repository. It's not too difficult to, at a user level, specify a caching artifactory instance to hold these.

In practice, as far as I've seen, one should specify the exact versions of the library you're pulling. This is done explicitly in the name of build reproducibility. The "main" repositories should be preferred unless something really custom is needed - in which case, you should be running your own package repository with the libraries you need.

So I guess more tips for maven:

1) Prefer releases over snapshots of libraries whenever possible.

2) Consider running an artifact repository if you're working with a large enough team. It's simple enough that it'd speed you up nicely even if your entire project lives on one laptop, if you're comfortable with a few details of running it. This is strictly optional but will make certain team-based workflows smoother.

3) Always specify versions manually! Don't set it to use the latest automatically. Is this ever a good idea?

4) Try not to include too many third-party repositories if you can.

It's not hard to get Maven dependencies under control. The dependencies are also cached locally, so Maven builds should depend on the internet only the very first time their dependency is included, and thereafter, every time they are updated, only for the package that was updated. Maven is actually -very- good at repeatable builds by default.


I agree with your posts, this one was the best. Maven has caused me more pain the goodness. Ant is dependable and predictable and Eclipse works far better IMO with Ant than when Maven tries to Mavenize a project.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: