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

Transitive dependencies override explicitly set scope.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Won't Fix
    • 2.0.9, 2.1.0-M1, 3.0-alpha-1
    • None
    • Dependencies
    • None

    Description

      Transitive dependencies override explicitly set scope.

      E.g. a project A depends on "Hibernate" with default scope and a project B depends on project A as well as on "Hibernate" for which it sets the scope explicitly to "provided". Further an EAR project C depends on project B (see the attached testcase).

      Now I would expect that C does not contain any jars for Hibernate and its dependencies since B explicitly set the scope to "provided". Sadly this is not the case and C contains all hibernate jars. The only way around this I have found is setting the scope to "provided" for Hibernate in A as well - which is just a crude hack that produces other issues.

      IMHO this is a bug because Maven should respect the overridden dependency scope since the current way forces me to set the scope to provided in A which is just wrong.

      Please try to get this fixed for 2.10 or 2.1 since it's a real pita atm.

      Attachments

        1. MMG-3890-core-it-suite.patch
          2 kB
        2. testcase.tar.bz2
          0.9 kB

        Issue Links

          Activity

            People

              schulte77 Christian Schulte
              bitshuffler Stephan Kleine
              Votes:
              6 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: