Skip to content

Excluding dependencies from included builds doesn't work in Gradle 9.3.0 #36331

@ulrikls

Description

@ulrikls

Current Behavior

Dependencies to included projects, which uses dependency substitution in the inclusion, can no longer be excluded. See reproducer project.

$ ./gradlew wrapper --gradle-version 9.3.0

BUILD SUCCESSFUL in 766ms
1 actionable task: 1 executed

$ ./gradlew dependencies --configuration=runtimeClasspath

> Task :dependencies

------------------------------------------------------------
Root project 'excluded-dependencies'
------------------------------------------------------------

runtimeClasspath - Runtime classpath of source set 'main'.
\--- org.example:other-dependency -> project :dependency

BUILD SUCCESSFUL in 701ms
1 actionable task: 1 executed

Expected Behavior

The dependency should be excluded:

$ ./gradlew wrapper --gradle-version 9.2.1

BUILD SUCCESSFUL in 690ms
1 actionable task: 1 executed

$ ./gradlew dependencies --configuration=runtimeClasspath

> Task :dependencies

------------------------------------------------------------
Root project 'excluded-dependencies'
------------------------------------------------------------

runtimeClasspath - Runtime classpath of source set 'main'.
No dependencies

BUILD SUCCESSFUL in 715ms
1 actionable task: 1 executed

Context (optional)

No response

Self-contained Reproducer Project

https://github.com/ulrikls/excluded-dependencies

Gradle version

9.3.0

Gradle version that used to work

9.2.1

Build scan URL (optional)

No response

Your Environment (optional)

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions