You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Ben Dean (JIRA)" <ji...@codehaus.org> on 2008/12/22 22:21:20 UTC

[jira] Created: (MNG-3939) dependencyManagement does not inherit imported dependencies

dependencyManagement does not inherit imported dependencies
-----------------------------------------------------------

                 Key: MNG-3939
                 URL: http://jira.codehaus.org/browse/MNG-3939
             Project: Maven 2
          Issue Type: Bug
          Components: Dependencies
    Affects Versions: 2.0.9
            Reporter: Ben Dean
         Attachments: maven-dependency-inherited-import.not-working.zip, maven-dependency-inherited-import.working.zip

I've attached a zip that has two versions of the same multi-module project. In the first version there is a parent-pom which defines a dependencyManagement section with one dependency (junit 4.4). I child project then inherits from the parent-pom and inherits the dependency management section including the version number for junit. Then then child project can have a dependency for junit and not care about the version number which is managed by the dependencyManagement inherited from the parent.

In the second version, the dependencyManagement of the parent has been moved to a dependency-pom. This makes sense because the dependencyManagement section for a multi-module project could get huge and it would be nice to keep the parent-pom small and clean and just import dependencyManagement as needed. The problem is that the child project does not inherit these imported dependencies. It seems to me that imported dependencyManagement sections should be inherited too. This is the error given when the child doesn't what version of junit to use:
    Project ID: maven.dependency.example:child
    POM Location: C:\sandbox\eclipse\default\maven example\child\pom.xml
    Validation Messages:
        [0]  'dependencies.dependency.version' is missing for junit:junit

This is somewhat related (maybe only tangentially) to the following issues:
    http://jira.codehaus.org/browse/MNG-3553
    http://jira.codehaus.org/browse/MNG-2314
    http://jira.codehaus.org/browse/MNG-3537
    maybe more ...

However, all those other issues seem to involve a more complex example than this issue. This issue is just dependencyManagement, import and inheritance.

-- 
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

        

[jira] Closed: (MNG-3939) dependencyManagement does not inherit imported dependencies

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3939?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann closed MNG-3939.
----------------------------------

       Resolution: Duplicate
    Fix Version/s:     (was: Issues to be reviewed for 3.x)
         Assignee: Benjamin Bentmann

The non-working example as provided suffers from a user error (missing type=pom). Once fixed, it's just a dup of MNG-4052.

> dependencyManagement does not inherit imported dependencies
> -----------------------------------------------------------
>
>                 Key: MNG-3939
>                 URL: http://jira.codehaus.org/browse/MNG-3939
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.9
>            Reporter: Ben Dean
>            Assignee: Benjamin Bentmann
>         Attachments: console_output.txt, maven-dependency-inherited-import.not-working.zip, maven-dependency-inherited-import.working.zip
>
>
> I've attached a zip that has two versions of the same multi-module project. In the first version there is a parent-pom which defines a dependencyManagement section with one dependency (junit 4.4). I child project then inherits from the parent-pom and inherits the dependency management section including the version number for junit. Then then child project can have a dependency for junit and not care about the version number which is managed by the dependencyManagement inherited from the parent.
> In the second version, the dependencyManagement of the parent has been moved to a dependency-pom. This makes sense because the dependencyManagement section for a multi-module project could get huge and it would be nice to keep the parent-pom small and clean and just import dependencyManagement as needed. The problem is that the child project does not inherit these imported dependencies. It seems to me that imported dependencyManagement sections should be inherited too. This is the error given when the child doesn't what version of junit to use:
>     Project ID: maven.dependency.example:child
>     POM Location: C:\sandbox\eclipse\default\maven example\child\pom.xml
>     Validation Messages:
>         [0]  'dependencies.dependency.version' is missing for junit:junit
> This is somewhat related (maybe only tangentially) to the following issues:
>     http://jira.codehaus.org/browse/MNG-3553
>     http://jira.codehaus.org/browse/MNG-2314
>     http://jira.codehaus.org/browse/MNG-3537
>     maybe more ...
> However, all those other issues seem to involve a more complex example than this issue. This issue is just dependencyManagement, import and inheritance.

-- 
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

        

[jira] Commented: (MNG-3939) dependencyManagement does not inherit imported dependencies

Posted by "Sebastian Paul (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-3939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=243541#action_243541 ] 

Sebastian Paul commented on MNG-3939:
-------------------------------------

I tried to reproduce this. First, I added <type>pom</type>, because Maven complained. Then I installed the dependency-pom. 
Checking with 'mvn help:effective-pom' shows that the parent contains the correct dependencyManagement and that the child contains the correct dependency to junit.
I think the issue can be closed.

> dependencyManagement does not inherit imported dependencies
> -----------------------------------------------------------
>
>                 Key: MNG-3939
>                 URL: http://jira.codehaus.org/browse/MNG-3939
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.9
>            Reporter: Ben Dean
>             Fix For: Issues to be reviewed for 3.x
>
>         Attachments: console_output.txt, maven-dependency-inherited-import.not-working.zip, maven-dependency-inherited-import.working.zip
>
>
> I've attached a zip that has two versions of the same multi-module project. In the first version there is a parent-pom which defines a dependencyManagement section with one dependency (junit 4.4). I child project then inherits from the parent-pom and inherits the dependency management section including the version number for junit. Then then child project can have a dependency for junit and not care about the version number which is managed by the dependencyManagement inherited from the parent.
> In the second version, the dependencyManagement of the parent has been moved to a dependency-pom. This makes sense because the dependencyManagement section for a multi-module project could get huge and it would be nice to keep the parent-pom small and clean and just import dependencyManagement as needed. The problem is that the child project does not inherit these imported dependencies. It seems to me that imported dependencyManagement sections should be inherited too. This is the error given when the child doesn't what version of junit to use:
>     Project ID: maven.dependency.example:child
>     POM Location: C:\sandbox\eclipse\default\maven example\child\pom.xml
>     Validation Messages:
>         [0]  'dependencies.dependency.version' is missing for junit:junit
> This is somewhat related (maybe only tangentially) to the following issues:
>     http://jira.codehaus.org/browse/MNG-3553
>     http://jira.codehaus.org/browse/MNG-2314
>     http://jira.codehaus.org/browse/MNG-3537
>     maybe more ...
> However, all those other issues seem to involve a more complex example than this issue. This issue is just dependencyManagement, import and inheritance.

-- 
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

        

[jira] Commented: (MNG-3939) dependencyManagement does not inherit imported dependencies

Posted by "Sebastian Paul (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-3939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=243542#action_243542 ] 

Sebastian Paul commented on MNG-3939:
-------------------------------------

I forgot to mention that I used Maven 2.2.1

> dependencyManagement does not inherit imported dependencies
> -----------------------------------------------------------
>
>                 Key: MNG-3939
>                 URL: http://jira.codehaus.org/browse/MNG-3939
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.9
>            Reporter: Ben Dean
>             Fix For: Issues to be reviewed for 3.x
>
>         Attachments: console_output.txt, maven-dependency-inherited-import.not-working.zip, maven-dependency-inherited-import.working.zip
>
>
> I've attached a zip that has two versions of the same multi-module project. In the first version there is a parent-pom which defines a dependencyManagement section with one dependency (junit 4.4). I child project then inherits from the parent-pom and inherits the dependency management section including the version number for junit. Then then child project can have a dependency for junit and not care about the version number which is managed by the dependencyManagement inherited from the parent.
> In the second version, the dependencyManagement of the parent has been moved to a dependency-pom. This makes sense because the dependencyManagement section for a multi-module project could get huge and it would be nice to keep the parent-pom small and clean and just import dependencyManagement as needed. The problem is that the child project does not inherit these imported dependencies. It seems to me that imported dependencyManagement sections should be inherited too. This is the error given when the child doesn't what version of junit to use:
>     Project ID: maven.dependency.example:child
>     POM Location: C:\sandbox\eclipse\default\maven example\child\pom.xml
>     Validation Messages:
>         [0]  'dependencies.dependency.version' is missing for junit:junit
> This is somewhat related (maybe only tangentially) to the following issues:
>     http://jira.codehaus.org/browse/MNG-3553
>     http://jira.codehaus.org/browse/MNG-2314
>     http://jira.codehaus.org/browse/MNG-3537
>     maybe more ...
> However, all those other issues seem to involve a more complex example than this issue. This issue is just dependencyManagement, import and inheritance.

-- 
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

        

[jira] Updated: (MNG-3939) dependencyManagement does not inherit imported dependencies

Posted by "Ben Dean (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3939?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ben Dean updated MNG-3939:
--------------------------

    Attachment: console_output.txt

I've attached the console output from doing a mvn clean install on the non-working version of the project.

Also, the working and non-working versions of the example project are committed as separate zip files.

> dependencyManagement does not inherit imported dependencies
> -----------------------------------------------------------
>
>                 Key: MNG-3939
>                 URL: http://jira.codehaus.org/browse/MNG-3939
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.9
>            Reporter: Ben Dean
>         Attachments: console_output.txt, maven-dependency-inherited-import.not-working.zip, maven-dependency-inherited-import.working.zip
>
>
> I've attached a zip that has two versions of the same multi-module project. In the first version there is a parent-pom which defines a dependencyManagement section with one dependency (junit 4.4). I child project then inherits from the parent-pom and inherits the dependency management section including the version number for junit. Then then child project can have a dependency for junit and not care about the version number which is managed by the dependencyManagement inherited from the parent.
> In the second version, the dependencyManagement of the parent has been moved to a dependency-pom. This makes sense because the dependencyManagement section for a multi-module project could get huge and it would be nice to keep the parent-pom small and clean and just import dependencyManagement as needed. The problem is that the child project does not inherit these imported dependencies. It seems to me that imported dependencyManagement sections should be inherited too. This is the error given when the child doesn't what version of junit to use:
>     Project ID: maven.dependency.example:child
>     POM Location: C:\sandbox\eclipse\default\maven example\child\pom.xml
>     Validation Messages:
>         [0]  'dependencies.dependency.version' is missing for junit:junit
> This is somewhat related (maybe only tangentially) to the following issues:
>     http://jira.codehaus.org/browse/MNG-3553
>     http://jira.codehaus.org/browse/MNG-2314
>     http://jira.codehaus.org/browse/MNG-3537
>     maybe more ...
> However, all those other issues seem to involve a more complex example than this issue. This issue is just dependencyManagement, import and inheritance.

-- 
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

        

[jira] Commented: (MNG-3939) dependencyManagement does not inherit imported dependencies

Posted by "Mike Youngstrom (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-3939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=172928#action_172928 ] 

Mike Youngstrom commented on MNG-3939:
--------------------------------------

I see a couple of possible problems in your not-working project.

1. You are build the child before you build the dependency-pom.  If the dependency pom doesn't exist before the child builds it won't work.

2. Your parent pom is depending upon the dependency-pom and building it.  This in general seems like a strange situation...though it may work.  Try creating a parent pom for your child project and build the parent pom and the dependency pom with a "build" pom.  Make sure the dependency-pom is before the child pom in the module list.

3. Your not specifying the "type" of your import pom with <type>pom</type>  not sure if this is necissary or not but I always do it.

> dependencyManagement does not inherit imported dependencies
> -----------------------------------------------------------
>
>                 Key: MNG-3939
>                 URL: http://jira.codehaus.org/browse/MNG-3939
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.9
>            Reporter: Ben Dean
>         Attachments: console_output.txt, maven-dependency-inherited-import.not-working.zip, maven-dependency-inherited-import.working.zip
>
>
> I've attached a zip that has two versions of the same multi-module project. In the first version there is a parent-pom which defines a dependencyManagement section with one dependency (junit 4.4). I child project then inherits from the parent-pom and inherits the dependency management section including the version number for junit. Then then child project can have a dependency for junit and not care about the version number which is managed by the dependencyManagement inherited from the parent.
> In the second version, the dependencyManagement of the parent has been moved to a dependency-pom. This makes sense because the dependencyManagement section for a multi-module project could get huge and it would be nice to keep the parent-pom small and clean and just import dependencyManagement as needed. The problem is that the child project does not inherit these imported dependencies. It seems to me that imported dependencyManagement sections should be inherited too. This is the error given when the child doesn't what version of junit to use:
>     Project ID: maven.dependency.example:child
>     POM Location: C:\sandbox\eclipse\default\maven example\child\pom.xml
>     Validation Messages:
>         [0]  'dependencies.dependency.version' is missing for junit:junit
> This is somewhat related (maybe only tangentially) to the following issues:
>     http://jira.codehaus.org/browse/MNG-3553
>     http://jira.codehaus.org/browse/MNG-2314
>     http://jira.codehaus.org/browse/MNG-3537
>     maybe more ...
> However, all those other issues seem to involve a more complex example than this issue. This issue is just dependencyManagement, import and inheritance.

-- 
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