This is an automated email from the ASF dual-hosted git repository.

sjaranowski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-parent.git


The following commit(s) were added to refs/heads/master by this push:
     new 5636c0f  Enhance target JDK definition for JDK >= 9 (#505)
5636c0f is described below

commit 5636c0f7da9b6e7ebb88e3df76fddae8e2e5f6ca
Author: Guillaume Nodet <[email protected]>
AuthorDate: Sat Nov 15 12:29:16 2025 +0100

    Enhance target JDK definition for JDK >= 9 (#505)
    
    * Enhance target JDK definition for JDK >= 1
    
    Defining maven.compiler.source and maven.compiler.target properties when
    running on JDK >= 9 has some side effects.
    
    Fixes #503
    
    Follow-up to https://github.com/apache/maven-apache-parent/pull/543 and 
https://github.com/apache/maven-apache-parent/pull/550
    
    * use javaVersion property
    
    ---------
    
    Co-authored-by: Slawomir Jaranowski <[email protected]>
---
 pom.xml | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/pom.xml b/pom.xml
index 58f9487..8bc1e87 100644
--- a/pom.xml
+++ b/pom.xml
@@ -961,8 +961,6 @@ under the License.
 
   <properties>
     <javaVersion>8</javaVersion>
-    <maven.compiler.source>${javaVersion}</maven.compiler.source>
-    <maven.compiler.target>${javaVersion}</maven.compiler.target>
     <maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
     
<checkstyle.includeTestSourceDirectory>true</checkstyle.includeTestSourceDirectory>
     <!-- in order to restore default annotation processing behaviour, please 
override with empty value -->
@@ -1118,7 +1116,7 @@ under the License.</licenseText>
           <artifactId>maven-pmd-plugin</artifactId>
           <version>3.28.0</version>
           <configuration>
-            <targetJdk>${maven.compiler.target}</targetJdk>
+            <targetJdk>${javaVersion}</targetJdk>
             <rulesets>
               <ruleset>rulesets/maven.xml</ruleset>
             </rulesets>
@@ -1198,7 +1196,7 @@ under the License.</licenseText>
               <configuration>
                 <rules>
                   <enforceBytecodeVersion>
-                    <maxJdkVersion>${maven.compiler.target}</maxJdkVersion>
+                    <maxJdkVersion>${javaVersion}</maxJdkVersion>
                   </enforceBytecodeVersion>
                 </rules>
                 <fail>true</fail>
@@ -1482,7 +1480,7 @@ under the License.</licenseText>
             <configuration>
               <toolchains>
                 <jdk>
-                  <version>${maven.compiler.target}</version>
+                  <version>${javaVersion}</version>
                 </jdk>
               </toolchains>
             </configuration>

Reply via email to