[ 
https://issues.apache.org/jira/browse/SUREFIRE-1004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16324585#comment-16324585
 ] 

ASF GitHub Bot commented on SUREFIRE-1004:
------------------------------------------

Github user Tibor17 commented on a diff in the pull request:

    https://github.com/apache/maven-surefire/pull/173#discussion_r161332171
  
    --- Diff: 
maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/DependencyScanner.java
 ---
    @@ -111,19 +112,46 @@ private static void scanArtifact( File artifact, 
TestFilter<String, String> filt
             {
                 for ( String groups : groupArtifactIds )
                 {
    +                // groupId:artifactId[:version[:type[:classifier]]]
                     String[] groupArtifact = groups.split( ":" );
    -                if ( groupArtifact.length != 2 )
    +                if ( groupArtifact.length < 2 || groupArtifact.length > 5 )
                     {
                         throw new IllegalArgumentException( "dependencyToScan 
argument should be in format"
    -                        + " 'groupid:artifactid': " + groups );
    +                        + " 
'groupid:artifactid[:version[:type[:classifier]]]': " + groups );
                     }
    -                if ( artifact.getGroupId().matches( groupArtifact[0] )
    -                    && artifact.getArtifactId().matches( groupArtifact[1] 
) )
    +                if ( artifactMatchesGavtc( artifact, groupArtifact ) )
                     {
                         matches.add( artifact.getFile() );
                     }
                 }
             }
             return matches;
         }
    +    
    +    private static boolean artifactMatchesGavtc( Artifact artifact, 
String[] gavtc )
    --- End diff --
    
    In my next comment I use "groups" as a parameter because the upper part has 
local variable "groups". You can rename it as you like.


> Enhance pattern/wildcard capabilities for dependenciesToScan to GAVT
> --------------------------------------------------------------------
>
>                 Key: SUREFIRE-1004
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1004
>             Project: Maven Surefire
>          Issue Type: Improvement
>          Components: Maven Failsafe Plugin, Maven Surefire Plugin
>    Affects Versions: 2.15
>            Reporter: Andreas Gudian
>
> * Enhance what has been built with SUREFIRE-569 to support patterns as in 
> maven-shade-plugin. Use maven-common-artifact-filters for that.
> * Add/Adapt documentation and examples.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to