Skip to content

Depending on multiple configurations leads to broken buildship classpath #21968

@netmikey

Description

@netmikey

Expected Behavior

Given subproject A:

apply plugin: 'java'

configurations {
    testConfig
}

// [...]

and subproject B:

apply plugin: 'java'

dependencies {
    implementation project(':A')
    testRuntimeOnly project(path: ':A', configuration: 'testConfig')
}

Things should work like before: subproject B has an implementation dependency on the main configuration and a test dependency on an additional configuration of subproject A. Those dependencies should work in buildship like in Gradle.

Current Behavior

There's only a test dependency in buildship, no implementation dependency.

Context

We use multiproject builds extensively. We usually have one core subproject and a bunch of other subprojects. The other subprojects often rely on some common test resources from the core subproject like logging configurations, test configurations, test keystores etc. So naturally, our subprojects depend on the code from the core subproject for their implementation classpath and depend on the test resources (exported in their own "configuration") for their testRuntimeOnly classpath.

This stopped working in Gradle 7.5.

Steps to Reproduce

I created a minimal project reproducing this error: buildship-bug.zip

Unzip it, the build should work when building on the command-line. However, importing this into Eclipse/Buildship, the compiler complains because of the aforementioned classpath issues.

Your Environment

Windows 10, Java 11, Gradle 7.5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:featureA new functionalityin:eclipse-pluginin:ideIssues related to using Gradle with an IDE like IntelliJ, Eclipse or Android Studio

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions