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

    https://github.com/apache/maven-surefire/pull/157#discussion_r135765515
  
    --- Diff: 
maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
 ---
    @@ -847,12 +847,31 @@ private DefaultScanResult scanDependencies()
             {
                 try
                 {
    +                DefaultScanResult scanResult = new DefaultScanResult( 
Collections.EMPTY_LIST );
    +                
    +                List<String> dependenciesToScan = new ArrayList();
    +                Collections.addAll( dependenciesToScan, 
getDependenciesToScan() );
    +                TestListResolver includedAndExcludedTests = 
getIncludedAndExcludedTests();
    +
    +                for ( MavenProject mavenProject : 
session.getSortedProjects() )
    +                {
    +                    String groupArtifactId = mavenProject.getGroupId() + 
":" + mavenProject.getArtifactId();
    +                    if ( dependenciesToScan.removeAll( 
Collections.singleton( groupArtifactId ) ) )
    +                    {
    +                        File outputDirectoryFile = new File( 
mavenProject.getBuild().getOutputDirectory() );
    +                        DirectoryScanner scanner =
    +                                new DirectoryScanner( outputDirectoryFile, 
includedAndExcludedTests );
    +                        scanResult = scanResult.append( scanner.scan() );
    +                    }
    +                }
    +
                     // @TODO noinspection unchecked, check MavenProject 3.x 
for Generics in surefire:3.0
                     @SuppressWarnings( "unchecked" )
    -                List<File> dependenciesToScan =
    -                    DependencyScanner.filter( project.getTestArtifacts(), 
Arrays.asList( getDependenciesToScan() ) );
    -                DependencyScanner scanner = new DependencyScanner( 
dependenciesToScan, getIncludedAndExcludedTests() );
    -                return scanner.scan();
    +                List<File> dependenciesToScanFile =
    --- End diff --
    
    Pls align to single line after using static import:
    `import static java.lang.Thread.currentThread;
    import static 
org.apache.maven.plugin.surefire.util.DependencyScanner.filter;
    import static java.util.Collections.singletonMap;`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to