Skip to content

test-jar dependency type is not properly handled with Gradle #1159

Open
@williamsuane

Description

@williamsuane

Generating new Gradle projects that contains testImplementation("org.springframework.cloud:spring-cloud-stream:test-binder@test-jar") fails with the following message when building

Could not find org.springframework.cloud:spring-cloud-stream:test-binder.
Required by:
    project :

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

How to replicate

Generate a new project Spring Boot 2.4, Java 11, Cloud Stream and Kafka Binder

Run ./gradlew build

The solution that worked was to replace testImplementation("org.springframework.cloud:spring-cloud-stream:test-binder@test-jar") by

testImplementation("org.springframework.cloud:spring-cloud-stream") {
        artifact {
            name = "spring-cloud-stream"
            extension = "jar"
            type ="test-jar"
            classifier = "test-binder"
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions