jorsol commented on code in PR #181: URL: https://github.com/apache/maven-compiler-plugin/pull/181#discussion_r1404858082
########## src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java: ########## @@ -1156,6 +1151,16 @@ public void execute() throws MojoExecutionException, CompilationFailureException incrementalBuildHelper.beforeRebuildExecution(incrementalBuildHelperRequest); + // Cleanup the generated sources directory + if (getGeneratedSourcesDirectory() != null) { Review Comment: Yes, let me explain, the generatedSourcesDirectory is actually the directory for the annotation processor's generated source code: https://github.com/apache/maven-compiler-plugin/blob/e5375fd10f00e4db5471bdc69ebdc4ba20f7bbdc/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java#L114-L122 Since the "incremental" feature is actually a rebuild feature, this directory is generated by the javac compiler, it needs to be cleaned before the rebuild of the module or the build will fail with strange errors, this probably fixes many bugs related to the "incremental" compilation and annotation processors. -- 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