Details
Description
MDEP-72 made DefaultProjectDependencyAnalyzer.buildArtifactClassMap() only consider jar files, i.e.:
if ( file != null && file.getName().endsWith( ".jar" ) )
This causes it to ignore all classes defined in a submodule of a multi-module project. See the attached example. It has two submodules:
- a, which defines an interface Foo
- b, which defines a class FooImpl that implements Foo
Running "mvn dependency:analyze" results in:
[WARNING] Unused declared dependencies found: [WARNING] com.example:a:jar:0.0.1-SNAPSHOT:compile
The following change fixes the issue:
if ( file != null && (file.getName().endsWith( ".jar" ) || file.isDirectory()) )
Attachments
Attachments
Issue Links
- depends upon
-
MSHARED-276 analyzer ignores project directories in a multi-module build
- Closed