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

Scope defined in dependencyManagement section of parent pom overwrites scope of current artifact

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.0.6
    • 2.0.7
    • Dependencies
    • None

    Description

      If the dependencyManagement contains also the current artifact with a scope, this scope will overwrite the scope of the current project.

      Use case: A global parent POM that defines the released versions of all artifacts. Those artifacts are all defined with "runtime" scope to enforce projects to declare compile time deps (workaround for MNG-2589) or some are declared with scope "test" since they should only be used in unit or it tests.

      Problem: If that artifact is build with M206, it does no longer compile.

      Reason: The declaration in the dependencyManagement section overwrites also the scope of the current artifact itself i.e. all the declared dependencies are suddenly also no longer in the compile scope.

      Solution: The dependencyManagement may not overwrite the scope of the current artifact.

      Workaround: Add for the current artifact in its own POM a dependencyManagement section where it is itself declared again with compile scope.

      Attachments

        1. MNG-2919.zip
          1 kB
          Joerg Schaible

        Issue Links

          Activity

            People

              pschneider Patrick Schneider
              joehni Joerg Schaible
              Votes:
              3 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: