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

Gradle resolver doesn't support custom configurations

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 3.0.0-beta-2
    • gradle
    • None

      Having a gradle project with additional source set and configurations, the Gradle resolver does not pickup the dependencies in the new configurations.

      build.gradle snippet:

      sourceSets {
        integrationTest {
          java {
            compileClasspath += main.output
            runtimeClasspath += main.output
            srcDir file('src/integrationTest/java')
          }
          resources.srcDir file('src/integrationTest/resources')
        }
      }
      configurations {
        integrationTestCompile.extendsFrom compile
        integrationTestRuntime.extendsFrom runtime
      }
      dependencies {
        integrationTestCompile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.7'
        integrationTestImplementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.7'
      }
      

      No matter which of the new configurations is used, the dependecy is not resolved when searching all scopes:

      Gradle.resolver()
        .forProjectDirectory(".")
        .importDependencies(ScopeType.values())
        .resolve()
        .asList(JavaArchive.class)
        .stream()
        .filter(a -> a.getName().contains("slf4j"))
        .forEach(System.out::println);
      

              Unassigned Unassigned
              aklemp Andreas Klemp (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: