Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

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

Aberta
#10,353 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

@jjh75607 já está trabalhando nisso.

Desde 28/8/2026.

  • #11996 de @jjh75607 — aberto

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
45/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
java
Domínio
build-system

Direção de pesquisa

Comece pelas linhas 59-63 de gradle/shading.gradle e reproduza a falha com ./gradlew :docs:examples:junit4:generic:jar :docs:examples:junit4:generic:test. Investigue como a configuração de shading conecta as tasks jar e test. Está concluído quando o comando terminar sem a falha do Gradle por dependência implícita.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

type/bug
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: https://github.com/testcontainers/testcontainers-java/blob/63189c8678f81c8ef4c431e4468ee74640682654/gradle/shading.gradle#L59-L63

The shading configuration should be adjusted or removed (e.g. https://github.com/testcontainers/testcontainers-java/issues/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

Linguagem predominante
Java
Estrelas
8.7k
Forks
1.9k
Merge médio
20h 43min
PRs com merge (30d)
4

Preparar o ambiente

Abrir no Codespaces

Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de testcontainers/testcontainers-java

Todas as issues de testcontainers/testcontainers-java

Issues semelhantes

Mais issues de Java

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.