I was thinking even about having this information in the repository.
Recently I have switched my main box to Gentoo linux, and they have a real nice installation system called Portage. Included in this system is the idea of dependencies. Let's say you want to install package A, and that package needs B, and C to be installed in order to function properly. You just issue a single command (emerge A) and the system calculates all the required dependencies, install them and finally install the required package.
I think in the case of Maven, a similar approach could be taken, so you should only specify Struts as a dependency and not all the other stuff that should be bundled with it. Maven could then download Struts and all its required dependencies.
Dependencies in Gentoo and Portage are extremely flexible, allowing you to specify that a package depends on an exact version of another, at least a version, until a version, or a range of versions. Using the same mechanism in Maven could lead to desirable behaviour, so maybe if you download Struts 1.0, you download with it commons-beanutils 1.4 (I don't know the right version) but if you download Struts 1.1, you download beanutils 1.6 (for example).
What do you think? Will you developers kill me for putting another thing in the wish list?
Regards Jose
Alex Arnell wrote:
I agree with this.
Instead of having a huge long list of dependecies, it would be nice if you could group dependecies. Using the Struts example below you could have a maven structure like the following
<dependency> <id>struts</id> <version>1.1-b3</version> <url>http://jakarta.apache.org/struts/</url> <depends> <dependency> <id>commons-beanutils</id> <version>1.6.1</version> </dependency> .... <!-- more dependencies --> </depends> </dependency>
This wouldn't reduce the number of depencies required to list in the project.xml file, but it would group them nicer so you can see exactly what is dependent on what, and it groups things nicely together.
You could even gank the idea of a file-set from ant, except call it a dependency-set, allowing you to define dependency sets for re-use. In this case (I cannot think of when it would be useful, but I am sure someone would find a place for it), you could define something like the following
<dependency-set id="dependency.set"> <dependency> ... </dependency> <dependency> .... </depenecency> </dependency-set>
<dependency> <id>myDependency</id> ... <depends> <dependency refid="dependecny.set" /> </depends> </dependency>
<dependency>
<id>myOtherDependency</id>
...
<depends>
<dependency refid="dependecny.set" />
</depends>
</dependency>
This would allow you to define two depencies and each one would depend on the same thing, but instead of having to type the same depencies over and over, it is declared once, and referenced with the refid tag. Also this would mean that the dependencies included via the refid are only downloaded and dealt with once.
Jose Gonzalez Gomez wrote:
Has Maven any way to specify nested or recursive dependencies? So now you must be asking what the #$@ is a recursive dependency...
An example: I'm just beginning to play a bit with maven, and have defined my first dependencies. I'm using Struts, so I thought I should put Struts in my dependencies in project.xml (I guess this is correct, isn't it), so when I try to compile my project, Maven downloads strtus-1.1-rc1.jar. But if you see a binary distribution of Struts there are a number of other jars bundled that are needed for Struts to work, so the question is, wouldn't be desirable to download them all so when you package your application, you are sure that it will function properly? Is there any way to do this, or do you have to put by hand all those other packages/jars as dependencies in project.xml?
Regards Jose
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- ------------------------------------------------------------------------ Jose Gonz�lez G�mez Software Architect +34 635 575 994 [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> http://www.opentechnet.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
