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

Test dependencies should override application dependencies only during testing

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • 4.0.0
    • None
    • None

    Description

      The following graph

      POM
      |->a 2.0 compile
      |-->b 2.0 compile
      |->b 1.0 test
      

      will be mediated to

      POM
      |->a 2.0 compile
      |->b 1.0 test
      

      The test dependency on b will make the transitive application dependency on b disappear. Maven should understand that the application dependency on b in version 2.0 is part of the application classpath and that the test dependency on b in version 1.0 is part of the test classpath only (overriding the application classpath). If someone adds a dependency on a project like that, the test dependency will disappear because the test scope is not transitive so that a "consuming" project gets a different application classpath than the project itself.

      Attachments

        1. MNG-6058.zip
          2 kB
          Christian Schulte

        Issue Links

          Activity

            People

              Unassigned Unassigned
              schulte77 Christian Schulte
              Votes:
              11 Vote for this issue
              Watchers:
              22 Start watching this issue

              Dates

                Created:
                Updated: