You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jose Gonzalez Gomez <jg...@opentechnet.com> on 2003/04/02 19:45:49 UTC

Recursive dependencies

    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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Recursive dependencies

Posted by Jose Gonzalez Gomez <jg...@opentechnet.com>.
    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: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>

-- 
------------------------------------------------------------------------
Jose González Gómez
Software Architect 	+34 635 575 994
jgonzalez@opentechnet.com <ma...@opentechnet.com>
http://www.opentechnet.com



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Recursive dependencies

Posted by di...@multitask.com.au.
The plan is for 1.0 to be able to specify a dependency on a POM 
(project.xml file for another project), and have Maven automatically 
flatten the dependencies.

If someone wants to step up and start coding it, I'd be happy to help.
--
dIon Gillard, Multitask Consulting
Blog:      http://www.freeroller.net/page/dion/Weblog
Work:      http://www.multitask.com.au


Alex Arnell <al...@bravenet.com> wrote on 03/04/2003 04:39:45 AM:

> 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: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> 
> -- 
> Alex Arnell
> Bravenet Web Services (www.bravenet.com)
> Software Engineer
> (Java Guru)
> (250) 954-0856 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Recursive dependencies

Posted by Michal Maczka <mm...@interia.pl>.
I think that this issue can be solved in much nicer way once generic
artifact support is implemented in Maven.

Then I imagine such algorithm:


<dependency>
      <id>struts</id>
      <version>1.1-b3</version>
      <type>group</type>
</dependency>


Then Maven will do:

1) Download the POM for struts-1.1-b3.
2) Resolve  all dependencies which are listed in struts POM.
3) Merge artifacts of struts with project's own artifacts

It should be very easy to implement such functionality.

Michal


> -----Original Message-----
> From: Alex Arnell [mailto:alex@bravenet.com]
> Sent: Wednesday, April 02, 2003 8:40 PM
> To: Maven Users List
> Subject: Re: Recursive dependencies
>
>
> 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: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
>
> --
> Alex Arnell
> Bravenet Web Services (www.bravenet.com)
> Software Engineer
> (Java Guru)
> (250) 954-0856
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
> ----------------------------------------------------------------------
> Powiedz jak wyglada komputer Twoich marzen i wygraj notebooka
> ADAX Mobile W1700X40 z Intel Pentium 4, DVD i wyjsciem TV!
> http://www.adax.pl/konkurs - ZAGRAJ!
>
>
>


----------------------------------------------------------------------
Biznesowy portal INTERIA.PL >>> http://link.interia.pl/f170c



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Recursive dependencies

Posted by Alex Arnell <al...@bravenet.com>.
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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

-- 
Alex Arnell
Bravenet Web Services (www.bravenet.com)
Software Engineer
(Java Guru)
(250) 954-0856 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org