desruisseaux commented on code in PR #1217:
URL:
https://github.com/apache/maven-compiler-plugin/pull/1217#discussion_r4727776623
##########
pom.xml:
##########
@@ -196,6 +228,48 @@ 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>
+ </requireJavaVersion>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <sources>
+ <!--
+ Main sources target JDK 17 (the minimum runtime version).
+ The JDK 22+ and 24+ override are compiled separately into
+ META-INF/versions/<version>/ to form a proper multi-release JAR.
+ -->
+ <source>
+ <directory>src/main/java</directory>
+ <targetVersion>17</targetVersion>
+ </source>
+ <source>
+ <directory>src/main/java22</directory>
+ <targetVersion>22</targetVersion>
+ </source>
Review Comment:
Yes this is intended, this is in anticipation for the real purpose of this
infrastructure, which is to use the classfile API in Java 24. It does not
appear yet only because not yet needed at this step.
--
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]