olamy commented on code in PR #172: URL: https://github.com/apache/maven-compiler-plugin/pull/172#discussion_r1090053416
########## src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java: ########## @@ -1733,30 +1740,46 @@ protected boolean isDependencyChanged() fileExtensions = Collections.unmodifiableList( Arrays.asList( "class", "jar" ) ); } - Date buildStartTime = getBuildStartTime(); + Instant buildStartTime = getBuildStartTime(); List<String> pathElements = new ArrayList<>(); pathElements.addAll( getClasspathElements() ); pathElements.addAll( getModulepathElements() ); for ( String pathElement : pathElements ) { - File artifactPath = new File( pathElement ); - if ( artifactPath.isDirectory() || artifactPath.isFile() ) + Path artifactPath = Paths.get( pathElement ); + + // Search files only on dependencies (other modules), not the current project. + if ( Files.isDirectory( artifactPath ) && !artifactPath.equals( getOutputDirectory().toPath() ) ) { - if ( hasNewFile( artifactPath, buildStartTime ) ) + try ( Stream<Path> walk = Files.walk( artifactPath ) ) Review Comment: I need to review more this. At this may have bad performance impact on large projects with a lot of modules and large source code (e.g source files number). this PR https://github.com/apache/maven-compiler-plugin/pull/163 use another path by storing some information rather than walking again and again the same source tree. -- 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: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org