Skip to content

[MSHARED-1211] Source-only dependencies are not detected #216

@jira-importer

Description

@jira-importer

Richard Eckart de Castilho opened MSHARED-1211 and commented

If a class in the src/main/java part module A has a source-only dependency on a class in module B, the dependency dependency of A to B is not detected. This can lead to build failures if any class in the src/main/test part of module A also has dependencies on module B as the analyzer claims that the dependency of module B should be moved to the test scope. Doing so - however - then breaks the build.

One such source-only dependency would be the import of a compile-time constant (e.g. static final String = "XXX") from a class in module B. Such constants are inlined into the class file produced for the class of module A. Thus, the compile-time dependency on module B cannot be determined by inspecting the class file using ASM.

I guess the only way to fix this issue would be introducing another analyzer implementation which would look at the source files. Currently (1.13.0), the only implementation of the ClassAnalyzer interface is based on ASM (i.e. on inspecting class files).


Affects: maven-dependency-analyzer-1.13.0

Issue Links:

  • MDEP-846 Source-only dependencies are not detected
    ("is duplicated by")

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority:majorMajor loss of function

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions