Uploaded image for project: 'ShrinkWrap Resolvers'
  1. ShrinkWrap Resolvers
  2. SHRINKRES-210

Dependency management with scopes are not resolved correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 2.2.0-beta-1
    • maven
    • None

      If the scope of an indirect dependency is changed in the dependencyManagement of your pom, this scope is not correctly taken into account when resolving compileAndRuntimeDependencies. I've created a very minimal testcase to demonstrate this problem:
      https://github.com/papegaaij/resolve-dep

      This testcase resolves the dependencies using:

      File[] jars = Maven.configureResolver().workOffline()
      	.loadPomFromFile("pom.xml")
      	.importCompileAndRuntimeDependencies().resolve()
      	.withTransitivity().as(File.class);
      

      The pom only defines 1 compile dependency (shrinkwrap-impl-base), which depends on 2 others (shrinkwrap-api and shrinkwrap-spi). shrinkwrap-api has a dependencyManagement with scope provided, so I expect this resolution to yield 2 files (base and spi), but it yields all 3.

            Unassigned Unassigned
            papegaaij Emond Papegaaij
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: