Skip to content

Gradle resolver doesn't support custom configurations #488

Open

Description

@xjusko

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);

Activity

  1. petrberan commented on Mar 4, 2026

    @petrberan
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions