desruisseaux commented on code in PR #3392:
URL: https://github.com/apache/maven-surefire/pull/3392#discussion_r3613851861


##########
maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java:
##########
@@ -1064,7 +1065,18 @@ private DefaultScanResult scanForTestClasses() throws 
MojoFailureException {
     }
 
     private DefaultScanResult scanDirectories() throws MojoFailureException {
-        DirectoryScanner scanner = new 
DirectoryScanner(getTestClassesDirectory(), getIncludedAndExcludedTests());
+        File scanDir = getTestClassesDirectory();
+        // Maven 4 Module Source Hierarchy: test classes may be nested under 
<module>/
+        if (scanDir != null && isNestedModuleLayout(getMainBuildPath())) {

Review Comment:
   The implementation of the `isNestedModuleLayout(File)` method invokes 
`findNestedModuleDescriptor(File)`, and the latter is invoked again below 
(together with another call to `getMainBuildPath()`). It should be possible to 
avoid this repetition, while I admit that the performance impact is probably 
negligible.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to