Ivy is everything Maven should have/could have been 2.5 years ago
I’ve been working with an ant-based dependency management tool called Ivy:
http://www.jayasoft.fr/org/modules/ivy/overview.php
We’ve been talking about restructuring the Spring Framework source layout at some point relatively soon (although it almost certainly won’t happen for 1.2), so that the individual components of Spring each have their own source level projects, instead of living under one big fat project with a fairly adhoc ant script building everything, and knowing about jar dependencies. This is something that’s actually not going to affect most Spring users in any way, but it’s going to make our lives easier as we add more code and more logical modules.
Any such move requires (in my opinion) the use of some dependency management tool or library, as it’s way to much work to maintain dependencies by hand in the ant scripts, in terms of dependencies between modules, or between code and various external jars.
Naturally, you’d think, Maven! I actually drank the Maven Koolaid pretty heavily about 2-3 years ago, spending pretty much time trying to use it in a big multi-project application, and hoping it would solve my build needs at a higher level than ant, before giving up for a while to let it mature. Well, after 3 years of development, Maven still does not support transitive closures of dependencies, so that if Project A depends on B, and B depends on C, when you want to build/package A, you don’t have to specifically add in C’s dependencies. To me this has always seemed to be the no-brainer, biggest value add feature Maven could have offered. It’s pretty easy to manage dependencies manually in an ant build for one single project, but it gets complex between multiple projects, and here Maven falls down. In the meantime, they’ve been putzin’ around with any number of other semi-useful plugins, instead of adding this vital capability. I know the mythical Maven 2 is supposed to support transitive dependencies, but there’s no sight of it.
So the point of this is that I’ve been using Ivy, and it’s sweet. All it does is let you declare dependencies between code, modules, and different configurations of those modules (think buildtime vs. runtime vs. deployed as a webapp, for example), and then move around jars correspondingly, including pulling them down from iBiblio or a filesystem location as needed. It doesn’t make a shiny web site, or polish your shoes, or even handle the build itself (you still have to do that), but frankly, handling dependencies in an intelligent fashion is my main concern, and where I think a great deal of the complexity in multi-project builds comes from.
Give it a try.
(added 2005-3-10 17:42): of course I realize that Maven does a lot more than handle dependencies. But when I said “2.5 years ago”, I was trying to say that Maven choose (in my opinion) some of the wrong problems to tackle first. Transitive dependencies are just so important to multi-project builds that it’s just inconceivable that after 3 years of development a there is no released version of Maven which supports them.


Modified

Peter says:
Added on March 10th, 2005 at 4:21 pmI totally agree that Maven needs transitive dependency support added - it baffles me that it’s still not in there (and some may remember that it was originally slated for 1.1, then quietly slipped out to 2.0 with nary an explanation). That being said, I’ve completely had enough of Ant too, even with the 1.6 improvements and a bunch of external plugins to cover some of its more glaring deficiencies.
But enough whinging - I’m wondering whether it might be possible to get the best of both worlds by integrating something like Ivy with Maven? After all Maven uses Ant under the hood, and presumably it’s possible to extend that Ant instance with plugins and expose them as Maven goals or what-have-you.
Has anyone tried doing this, or thought about doing it?
Colin Sampaleanu (blog author) says:
Added on March 10th, 2005 at 4:41 pmMy understanding (as per a discussion at TSSJS a few days ago with somebody) is that Jason Van Zyl actually has Maven 2 running in almost final form, and it includes transitive dependencies. However, the problem here is that there’s essentially no external visibility for Maven 2. For all I know, it may be another 3 years before it’s actually out. On top of that, Maven _is_ another tool entirely, and switching over to it from ant requires scrapping your ant build completely, or maintaining two build systems separately. The attraction to something like Ivy is that it takes care of one of the biggest problems when using Ant with multi-project builds, while still allowing most of the ant build to be used as-is. Together with a base build system that is imported from (resulting in a build script of only a few lines in each project), the value proposition for Maven (at least Maven 1) is smaller and smaller.
However, I’ll certainly give Maven 2 a try when it’s available.
Nobody says:
Added on June 23rd, 2005 at 1:58 amNot to criticize your position, but your blog entry is misleading some people to conclude maven is bad and ivy is good, thus they need to use ivy becasue you said so. Even though you stated pretty clearly, I don’t know if people are understanding ivy is good only when you have a existing ant based build system. Maven, while not perfect, takes care of a lot of tedious (and often buggy) stuff in your build system - creating jar, war, compiling, testing etc, which have to be implemented by yourself in ant world as you pointed out, and usually in ad hoc fashion, which again you pointed out.
I’m not a strong maven advocate or anything but I think everybody who have used both ant and maven should see the value maven brings to the table.
BTW, I am saying this because transitive deps is not a huge issue for me in our project which include 6-7 single project and a couple of multi-projects, because we are also relying maven to manage our eclipse classpath. So we have to explicitly declare all the dependencies anyway. I just fear that if we manage it manually, we will eventually get out of sync from maven build and eclipse build. (Do you have a good solution for this?).
Lastly, before talking about maven for its lack of transitive dependencies (which I do not disagree with your point), I’d like to point out that it’s a flaw in java’s jar packaging design, which they are trying to fix, which is 5-6 years too late. sun just should hire super smart small talk guy and implement all the small talk features and get it over with.