Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
3.1.1
-
None
-
None
-
Windows 10, JDK 1.8.0_181
Description
I would like to analyze all dependencies, but those with a groupId starting with "rhc."
I'm using the following configuration:
<configuration> <dependenciesToAnalyzeIncludes> <include>*:*</include> </dependenciesToAnalyzeIncludes> <dependenciesToAnalyzeExcludes> <exclude>rhc.*:*</exclude> </dependenciesToAnalyzeExcludes> </configuration>
I expect the resulting command to look like:
cmd.exe /X /C ""C:\Program Files\Java\jdk1.8.0_181\bin\jdeps.exe" -cp {All rhc.* dependencies} -P [myPath]\target\classes [All other dependencies]
Instead all the dependencies appear in the classpath (-cp) section and only the classes folder is left at the end.
Looking at the code, I see that the method getDependenciesToAnalyze in AbstractJDepsMojo does the following:
if ( includes.matchesPatternStart( versionlessKey, true ) && !excludes.matchesPatternStart( versionlessKey, true ) ) { jdepsClasses.add( artifact.getFile().toPath() ); }
I don't know what "matchesPatternStart" is suppose to do, but the following:
MatchPatterns.from("org.foo.*:*").matchesPatternStart("com.google.guava:guava", true)
returns true, while I would expect a mismatch here.
Calling matches instead of matchesPatternStart seems to fix the issue.