maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-François Lecomte (JIRA) <>
Subject [jira] [Created] (MJDEPS-22) dependenciesToAnalyzeIncludes and dependenciesToAnalyzeExcludes don't work as expected
Date Thu, 07 Feb 2019 16:05:00 GMT
Jean-François Lecomte created MJDEPS-22:

             Summary: dependenciesToAnalyzeIncludes and dependenciesToAnalyzeExcludes don't
work as expected
                 Key: MJDEPS-22
             Project: Maven JDeps Plugin
          Issue Type: Bug
    Affects Versions: 3.1.1
         Environment: Windows 10, JDK 1.8.0_181
            Reporter: Jean-François Lecomte

I would like to analyze all dependencies, but those with a groupId starting with "rhc."
I'm using the following 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("*:*").matchesPatternStart("", true)
returns true, while I would expect a mismatch here.
Calling matches instead of matchesPatternStart seems to fix the issue.

This message was sent by Atlassian JIRA

View raw message