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


##########
src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java:
##########
@@ -714,6 +714,11 @@ final EnumSet<IncrementalBuild.Aspect> 
incrementalCompilationConfiguration() {
      * @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) {

Review Comment:
   💡 **Nit (Javadoc):** The method's Javadoc describes amending incremental 
compilation for annotation processors, but the new `proc=only` guard is a 
different concern — it disables incremental compilation entirely. Consider 
updating the Javadoc to mention this:
   
   ```suggestion
        * Amends the configuration of incremental compilation. If annotation 
processing only is requested
        * ({@code proc=only}), incremental compilation is disabled so that 
processors always run.
        * Otherwise, if an annotation processor is present, the incremental 
configuration is amended
        * to also rebuild on source additions and changes.
   ```



##########
src/test/resources/unit/compiler-proc-only-test/plugin-config.xml:
##########
@@ -0,0 +1,38 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<project>
+  <build>
+    <directory>${project.basedir}/target</directory>
+    <outputDirectory>${project.basedir}/target/classes</outputDirectory>
+    <plugins>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <compileSourceRoots>
+            
<compileSourceRoot>${project.basedir}/src/main/java</compileSourceRoot>
+          </compileSourceRoots>
+          <compilerId>maven-compiler-stub</compilerId>
+          <incrementalCompilation>classes</incrementalCompilation>
+          <proc>only</proc>

Review Comment:
   💡 **Suggestion:** The fixture hardcodes 
`<incrementalCompilation>classes</incrementalCompilation>`, but the most common 
user scenario is with `incrementalCompilation` unset (the default). The fix 
works for both paths — `proc=only` fires before the 
`isAbsent(incrementalCompilation)` check — but it would be slightly more 
convincing to also test the default case (or test this one without the explicit 
`incrementalCompilation` line, since the default path is what issue #1006 
describes).



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