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


##########
pom.xml:
##########
@@ -196,6 +228,54 @@ under the License.
         </plugin>
       </plugins>
     </pluginManagement>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-enforcer-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>enforce-java-build-version</id>
+            <goals>
+              <goal>enforce</goal>
+            </goals>
+            <configuration>
+              <rules>
+                <requireJavaVersion>
+                  <!--
+                    Building this plugin requires JDK 24+ so that the 
java.lang.classfile
+                    classes in src/main/java24/ can always be compiled with 
-release 24.
+                    The compiled plugin JAR targets JDK 17 for main sources 
and JDK 24
+                    for the classfile-backed code, and runs on any JVM >= 17.
+                  -->
+                  <version>[24,)</version>

Review Comment:
   Important: Enforcer requires JDK 24+ but the java24 source directory doesn't 
exist. The comment says 'Building this plugin requires JDK 24+ so that the 
java.lang.classfile classes in src/main/java24/ can always be compiled', but 
src/main/java24 is commented out in <sources> (line 272) and the directory 
doesn't exist. This prevents building on JDK 22-23 even though only JDK 22+ is 
actually needed.
   
   **Failure scenario:** Developer on JDK 23 runs mvn install → enforcer fails 
with 'Detected JDK Version: 23 is not in the allowed range [24,)' even though 
the build would succeed since java24 sources don't exist yet.
   
   **Fix:** Change requireJavaVersion to [22,) or add a note that JDK 24+ is 
for future work.
   
   _Claude Code on behalf of Guillaume Nodet_



##########
.github/workflows/maven-verify.yml:
##########
@@ -26,9 +26,8 @@ jobs:
     name: Verify
     uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v5
     with:
-      jdk-distribution-matrix: '[ "temurin", "zulu", "microsoft" ]'
+      ff-jdk: '25'

Review Comment:
   Important: CI only tests on JDK 25, but plugin runs on JDK 17+. The 
jdk-matrix is now '[ "25" ]' which removes testing on the minimum supported JDK 
17 and intermediate versions like JDK 21 (LTS) and JDK 22 (first version with 
JDK-8318913 fix). This reduces test coverage and could miss runtime bugs on 
older JDKs.
   
   **Failure scenario:** Plugin has a bug that only manifests on JDK 17-21 
(e.g., multi-release JAR classpath issue, ASM compatibility) → CI on JDK 25 
passes → bug ships to users on older JDKs.
   
   **Fix:** Test on multiple JDK versions including 17 (minimum), 21 (LTS), 22 
(fix boundary), and 25 (latest).
   
   _Claude Code on behalf of Guillaume Nodet_



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