Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-3939

dependencyManagement does not inherit imported dependencies

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.0.9
    • None
    • Dependencies
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              bentmann Benjamin Bentmann
              bdean42 Ben Dean
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: