You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Mike Whittemore (JIRA)" <ji...@codehaus.org> on 2006/02/09 18:54:47 UTC

[jira] Created: (MNG-2059) Add ability to depend on a group of dependencies with a single dependency element.

Add ability to depend on a group of dependencies with a single dependency element.
----------------------------------------------------------------------------------

         Key: MNG-2059
         URL: http://jira.codehaus.org/browse/MNG-2059
     Project: Maven 2
        Type: New Feature

 Environment: n/a
    Reporter: Mike Whittemore
    Priority: Minor


It would be convenient and reduce maintenance if Maven2 has the ability to create a group of dependencies and then reference them via a single dependency entry. Something like this:

In master pom:
<dependencyGroups>
&nbsp;&nbsp;<dependencyGroup>
&nbsp;&nbsp;&nbsp;&nbsp;<name>logging</name>
&nbsp;&nbsp;&nbsp;&nbsp;<dependencies>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<dependency>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<groupId>apache</groupId>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<artifactId>commons-logging</artifactId>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</dependency>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<dependency>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<groupId>apache</groupId>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<artifactId>log4j</artifactId>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</dependency>
&nbsp;&nbsp;&nbsp;&nbsp;<dependencies>
&nbsp;&nbsp;</dependencyGroup>
</dependencyGroups>

In child pom:
<dependencies>
&nbsp;&nbsp;<dependency>
&nbsp;&nbsp;&nbsp;&nbsp;<group>logging</group>
&nbsp;&nbsp;</dependency>
</dependencies>

In my particular case, we have a large software project with a large hierarchy of sub-projects that is continually growing. Many of the projects share the same dependencies, but do not necessarily have a parent-child relationship. If I have several projects that need, for example, the same 12 ORB implementation dependencies, it would be nice to declare that group of 12 dependencies as a "group" and then reference it from each project.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Commented: (MNG-2059) Add ability to depend on a group of dependencies with a single dependency element.

Posted by "Emmanuel Venisse (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2059?page=comments#action_58272 ] 

Emmanuel Venisse commented on MNG-2059:
---------------------------------------

Have you try this:

in parent pom:
<dependencyManagement>
  <dependency>
    <groupId>your_groupId</groupId>
    <artifactId>your_artifactId</artifactId>
    <version>your_version</version>
    <type>pom</type>                 <!-- This dependency is a pom that contains a list of dependencies required by child project -->
  </dependency>
</dependencyManagement>

in child pom:
<dependency>
    <groupId>your_groupId</groupId>
    <artifactId>your_artifactId</artifactId>
</dependency>


> Add ability to depend on a group of dependencies with a single dependency element.
> ----------------------------------------------------------------------------------
>
>          Key: MNG-2059
>          URL: http://jira.codehaus.org/browse/MNG-2059
>      Project: Maven 2
>         Type: New Feature

>  Environment: n/a
>     Reporter: Mike Whittemore
>     Priority: Minor

>
>
> It would be convenient and reduce maintenance if Maven2 has the ability to create a group of dependencies and then reference them via a single dependency entry. Something like this:
> In master pom:
> <dependencyGroups>
> &nbsp;&nbsp;<dependencyGroup>
> &nbsp;&nbsp;&nbsp;&nbsp;<name>logging</name>
> &nbsp;&nbsp;&nbsp;&nbsp;<dependencies>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<dependency>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<groupId>apache</groupId>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<artifactId>commons-logging</artifactId>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</dependency>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<dependency>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<groupId>apache</groupId>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<artifactId>log4j</artifactId>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</dependency>
> &nbsp;&nbsp;&nbsp;&nbsp;<dependencies>
> &nbsp;&nbsp;</dependencyGroup>
> </dependencyGroups>
> In child pom:
> <dependencies>
> &nbsp;&nbsp;<dependency>
> &nbsp;&nbsp;&nbsp;&nbsp;<group>logging</group>
> &nbsp;&nbsp;</dependency>
> </dependencies>
> In my particular case, we have a large software project with a large hierarchy of sub-projects that is continually growing. Many of the projects share the same dependencies, but do not necessarily have a parent-child relationship. If I have several projects that need, for example, the same 12 ORB implementation dependencies, it would be nice to declare that group of 12 dependencies as a "group" and then reference it from each project.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Commented: (MNG-2059) Add ability to depend on a group of dependencies with a single dependency element.

Posted by "Mike Whittemore (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2059?page=comments#action_58274 ] 

Mike Whittemore commented on MNG-2059:
--------------------------------------

Yes, and I do it wherever I can. Here's why I feel the "grouping" funtionality would be beneficial:

We organize our projects based on their relationships and not the relationships of their dependencies. So, for example, if projects A, B, and C are related they will have a common parent pom, and if projects X, Y, and Z are related they will have a common parent pom, and both parent poms will have a shared parent at some higher level. Projects A, B, and C though closely related, may not have the same direct dependencies.

Where my suggestion comes into play is if projects A and Z both need 12 ORB dependencies, I'd like to not have to duplicate all 12 in both poms. I'd also like to not have to place them in a common parent pom as "regular" dependencies because then other projects that don't need those dependencies will inherit them. I could move A and Z under a shared parent by themselves, but then I lose the logical grouping of the projects (for example A and Z might be totally unrelated except that deep down inside they happen to both use CORBA). I feel some grouping mechanism is the best way to deal with this, but I'm definitely interested in alternate suggestion.

Your suggestion is a good workaround in that it removes the duplication in the pom files, but it feels wrong to me in that it makes projects depend on things they don't truly depend on.



> Add ability to depend on a group of dependencies with a single dependency element.
> ----------------------------------------------------------------------------------
>
>          Key: MNG-2059
>          URL: http://jira.codehaus.org/browse/MNG-2059
>      Project: Maven 2
>         Type: New Feature

>  Environment: n/a
>     Reporter: Mike Whittemore
>     Priority: Minor

>
>
> It would be convenient and reduce maintenance if Maven2 has the ability to create a group of dependencies and then reference them via a single dependency entry. Something like this:
> In master pom:
> <dependencyGroups>
> &nbsp;&nbsp;<dependencyGroup>
> &nbsp;&nbsp;&nbsp;&nbsp;<name>logging</name>
> &nbsp;&nbsp;&nbsp;&nbsp;<dependencies>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<dependency>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<groupId>apache</groupId>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<artifactId>commons-logging</artifactId>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</dependency>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<dependency>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<groupId>apache</groupId>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<artifactId>log4j</artifactId>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</dependency>
> &nbsp;&nbsp;&nbsp;&nbsp;<dependencies>
> &nbsp;&nbsp;</dependencyGroup>
> </dependencyGroups>
> In child pom:
> <dependencies>
> &nbsp;&nbsp;<dependency>
> &nbsp;&nbsp;&nbsp;&nbsp;<group>logging</group>
> &nbsp;&nbsp;</dependency>
> </dependencies>
> In my particular case, we have a large software project with a large hierarchy of sub-projects that is continually growing. Many of the projects share the same dependencies, but do not necessarily have a parent-child relationship. If I have several projects that need, for example, the same 12 ORB implementation dependencies, it would be nice to declare that group of 12 dependencies as a "group" and then reference it from each project.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Closed: (MNG-2059) Add ability to depend on a group of dependencies with a single dependency element.

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-2059?page=all ]
     
Brett Porter closed MNG-2059:
-----------------------------

     Assign To: Brett Porter
    Resolution: Won't Fix

Emmanuel's inclusion of the tag in <dependencyManagement> makes sure the dependencies aren't inherited if you don't want them. He's specified exactly what you asked for in a way that works today :)

> Add ability to depend on a group of dependencies with a single dependency element.
> ----------------------------------------------------------------------------------
>
>          Key: MNG-2059
>          URL: http://jira.codehaus.org/browse/MNG-2059
>      Project: Maven 2
>         Type: New Feature

>  Environment: n/a
>     Reporter: Mike Whittemore
>     Assignee: Brett Porter
>     Priority: Minor

>
>
> It would be convenient and reduce maintenance if Maven2 has the ability to create a group of dependencies and then reference them via a single dependency entry. Something like this:
> In master pom:
> <dependencyGroups>
> &nbsp;&nbsp;<dependencyGroup>
> &nbsp;&nbsp;&nbsp;&nbsp;<name>logging</name>
> &nbsp;&nbsp;&nbsp;&nbsp;<dependencies>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<dependency>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<groupId>apache</groupId>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<artifactId>commons-logging</artifactId>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</dependency>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<dependency>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<groupId>apache</groupId>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<artifactId>log4j</artifactId>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</dependency>
> &nbsp;&nbsp;&nbsp;&nbsp;<dependencies>
> &nbsp;&nbsp;</dependencyGroup>
> </dependencyGroups>
> In child pom:
> <dependencies>
> &nbsp;&nbsp;<dependency>
> &nbsp;&nbsp;&nbsp;&nbsp;<group>logging</group>
> &nbsp;&nbsp;</dependency>
> </dependencies>
> In my particular case, we have a large software project with a large hierarchy of sub-projects that is continually growing. Many of the projects share the same dependencies, but do not necessarily have a parent-child relationship. If I have several projects that need, for example, the same 12 ORB implementation dependencies, it would be nice to declare that group of 12 dependencies as a "group" and then reference it from each project.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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