Skip to content

Debugging is not possible with downloaded sources #762

@zbstof

Description

@zbstof

Steps to reproduce:

  1. Create project that uses testcontainers
  2. Download testcontainers sources (for example, navigate to GenericContainer.class and clicking 'Download sources' in IntelliJ IDEA)
  3. Create breakpoint in some file that uses lombok and shading of dependencies: https://github.com/testcontainers/testcontainers-java/blob/master/core/src/main/java/org/testcontainers/containers/DockerComposeContainer.java#L629
    Result: When breakpoint is hit, instruction pointer point at the different location due to the different between line numbers in bytecode and source.
    Additionally, all the shaded dependencies such as org.zeroturnaround.exec.InvalidExitValueException; are shown in red, as they don't exist on the classpath

Expected result:

  1. I can navigate and step into to any shaded dependency and
  2. Any breakpoint location works in lombok-enhanced source files.

Solution:
Run

  • delombok
  • shade plugin
    before packaging source jar

Current workaround:
If I want to read sources, I download them
If I want to debug, I manually remove sources from IntelliJ project setup

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions