Skip to content

[Bug]: Library source does not match the bytecode for class GenericContainer #9220

Open

Description

@jpmartins

Module

Core

Testcontainers version

1.20.1

Using the latest Testcontainers version?

Yes

Host OS

macOs 14.6.1

Host Arch

ARM (Apple M2)

Docker version

-

What happened?

While trying to debug testcontainers potential bug, I discovered that sources published are not the correct.

The testcontainers-1.20.1-sources.jar content does not match testcontainers-1.20.1.jar content.

For example the GenericContainer class in testcontainers-1.20.1-sources.jar does not have public @nonnull List getExtraHosts() method... that is present in javadoc and in the library class at runtime.

Relevant log output

No response

Additional Information

No response

Activity

  1. kiview commented on Sep 12, 2024

    @kiview
    Member

    Hey @jpmartins, thanks for reporting.

    We are using the delombok task from the Gradle-Lombok plugin we are using.

    I don't know what else we can do to mitigate the situation (besides removing Lombok altogether), suggestions are welcome.

  2. wendigo commented on Oct 7, 2024

    @wendigo

    This is causing our project to fail with the cryptic error:

    java: com.sun.tools.javac.code.Symbol$CompletionFailure: class file for lombok.NonNull not found
    

    when we use JDK 23 to compile a project in IntelliJ so the question is: why the import lombok.NonNull; is retained in the source code of the JdbcDatabaseContainer ?

  3. wendigo commented on Oct 7, 2024

    @wendigo

    repro-intellij.zip

    Here's a sample repro that will fail to build when JDK 23 is used, due to the import lombok.Nonnull and it's usages being retained in the compiled JdbcDatabaseContainer class. It seems that delombok plugin is not doing its job properly

  4. AB-xdev commented on Sep 16, 2026

    @AB-xdev
    Contributor

    Duplicate of #8281

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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