Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dependencies task does not list dependencies declared via defaultDependencies #21868

Open
breskeby opened this issue Sep 5, 2022 · 0 comments
Assignees
Labels
a:bug in:dependency-declarations variant notation attributes capability substitution in:reporting-tasks help dependencyInsight dependencies

Comments

@breskeby
Copy link
Contributor

breskeby commented Sep 5, 2022

When having a dependency declared via Configuration#defaultDependencies(...), these dependencies are not shown when running ./gradlew dependencies

Expected Behavior

Dependencies declared as default dependencies are shown by the gradle dependencies task

Current Behavior

Dependencies declared as default dependencies are not shown by the gradle dependencies task

Context

We run into this when testing the latest 7.6 Gradle nightly as we have tests started failing that rely on that functionality

Steps to Reproduce

  • Create build script with content:
plugins {
    id 'java-library'
}

repositories {
    // Use Maven Central for resolving dependencies.
    mavenCentral()
}

// Use JUnit Jupiter for testing by default.
configurations.testImplementation.defaultDependencies {
  it.add(dependencies.create('org.junit.jupiter:junit-jupiter:5.8.2'))
}

tasks.named('test') {
    // Use JUnit Platform for unit tests.
    useJUnitPlatform()
}
  • run gradle dependencies with latest gradle nightly
  • output (among other listed configurations):
testImplementation - Implementation only dependencies for source set 'test'. (n)
No dependencies

Interestingly running it with a configuration name passed is broken already in earlier gradle versions:

  • run gradle dependencies --configuration testImplementation with latest gradle nightly
  • output (among other listed configurations):
testImplementation - Implementation only dependencies for source set 'test'. (n)
No dependencies

Your Environment

Gradle 7.6-20220904232438+0000
------------------------------------------------------------

Build time:   2022-09-04 23:24:38 UTC
Revision:     8d8c0e22110d83e048c57ef88ade27fa8e6a3a76

Kotlin:       1.7.10
Groovy:       3.0.11
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          11.0.16 (Amazon.com Inc. 11.0.16+8-LTS)
OS:           Mac OS X 12.5.1 x86_64
@jbartok jbartok added in:reporting-tasks help dependencyInsight dependencies in:dependency-declarations variant notation attributes capability substitution and removed to-triage labels Sep 7, 2022
@ljacomet ljacomet self-assigned this Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug in:dependency-declarations variant notation attributes capability substitution in:reporting-tasks help dependencyInsight dependencies
Projects
None yet
Development

No branches or pull requests

3 participants