olamy commented on code in PR #172: URL: https://github.com/apache/maven-compiler-plugin/pull/172#discussion_r1095293400
########## src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java: ########## @@ -1917,7 +1965,7 @@ private DirectoryScanResult computeInputFileTreeChanges( IncrementalBuildHelper } catch ( IOException e ) { - throw new MojoExecutionException( "Error reading old mojo status " + mojoConfigFile, e ); + throw new UncheckedIOException( "Error reading old mojo status " + mojoConfigFile, e ); Review Comment: why changing that? ########## 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: my concern is the method `computeInputFileTreeChanges` already scanning files and here you add another source tree scanning so maybe `IncrementalBuildHelper` could be improved to store the information you need? (in a similar logic as this PR https://github.com/apache/maven-compiler-plugin/pull/163 ). ? regarding `large project` what sort of figures? because this `large` can be relative ;) -- 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