FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[Bug]: shading causes Gradle failure as jar and test tasks are not properly wired · Issue #10353 · testcontainers/testcontainers-java · GitHub

[Bug]: shading causes Gradle failure as jar and test tasks are not properly wired #10353

Description

Module

Core

Testcontainers version

1.21.1

Using the latest Testcontainers version?

Yes

Host OS

all

Host Arch

all

Docker version

n/a

What happened?

The following part of the build script causes the failure:

// Add shaded JARs first
tasks.test.classpath = findShadedProjects(project)
.plus(project)
.sum { it.tasks.findByName("shadowJar").outputs.files }
.plus(sourceSets.test.runtimeClasspath)

The shading configuration should be adjusted or removed (e.g. #8612)

$ ./gradlew :docs:examples:junit4:generic:jar :docs:examples:junit4:generic:test

Configuration on demand is an incubating feature.
> Task :docs:examples:junit4:generic:test FAILED

[Incubating] Problems report is available at: file:///Users/kevincooney/git/testcontainers-java/build/reports/problems/problems-report.html

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':docs:examples:junit4:generic:test' (type 'Test').
  - Gradle detected a problem with the following location: '/Users/kevincooney/git/testcontainers-java/docs/examples/junit4/generic/build/libs/generic.jar'.
    
    Reason: Task ':docs:examples:junit4:generic:test' uses this output of task ':docs:examples:junit4:generic:jar' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':docs:examples:junit4:generic:jar' as an input of ':docs:examples:junit4:generic:test'.
      2. Declare an explicit dependency on ':docs:examples:junit4:generic:jar' from ':docs:examples:junit4:generic:test' using Task#dependsOn.
      3. Declare an explicit dependency on ':docs:examples:junit4:generic:jar' from ':docs:examples:junit4:generic:test' using Task#mustRunAfter.
    
    For more information, please refer to https://docs.gradle.org/8.13/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

Relevant log output

Additional Information

No response

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


    Back | FazBrowse Home | New Git URL