efegokdemir commented on code in PR #1136:
URL: 
https://github.com/apache/maven-compiler-plugin/pull/1136#discussion_r4178995126


##########
src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java:
##########


Review Comment:
   Added the requested note in ea009b6. The Javadoc now states that uncertain 
detection (including pre-Java-23 defaults) conservatively returns true.



##########
src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java:
##########
@@ -708,15 +708,24 @@ final EnumSet<IncrementalBuild.Aspect> 
incrementalCompilationConfiguration() {
     }
 
     /**
-     * Amends the configuration of incremental compilation for the presence of 
annotation processors.
+     * Amends the default configuration of incremental compilation for 
annotation processing.
+     * When processing is explicitly requested, incremental compilation is 
disabled so that processors always run.
+     * On Java versions before 23, an absent {@code proc} value only implies 
the compiler's default processing mode;
+     * it does not prove that a processor is present, so the traditional 
rebuild-on-add/change behavior is retained.
+     * This method does not amend an explicitly configured {@link 
#incrementalCompilation} value.
      *
      * @param aspects the configuration to amend if an annotation processor is 
found
      * @param dependencyTypes the type of dependencies, for checking if any of 
them is a processor path
      */
     final void amendincrementalCompilation(EnumSet<IncrementalBuild.Aspect> 
aspects, Set<PathType> dependencyTypes) {
         if (isAbsent(incrementalCompilation) && 
hasAnnotationProcessor(dependencyTypes)) {
-            aspects.add(IncrementalBuild.Aspect.REBUILD_ON_ADD);
-            aspects.add(IncrementalBuild.Aspect.REBUILD_ON_CHANGE);
+            if (isAbsent(proc) && !isVersionEqualOrNewer(RELEASE_23)) {
+                aspects.add(IncrementalBuild.Aspect.REBUILD_ON_ADD);

Review Comment:
   Added the requested explanation in ea009b6 above the intermediate 
pre-Java-23 strategy; no runtime behavior changed.



-- 
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