desruisseaux commented on code in PR #543:
URL: 
https://github.com/apache/maven-apache-parent/pull/543#discussion_r2431614901


##########
pom.xml:
##########
@@ -497,6 +494,17 @@ under the License.
       </build>
     </profile>
     <!-- END SNIPPET: release-profile -->
+    <profile>
+      <id>jdk8</id>
+      <activation>
+        <jdk>[,9)</jdk>
+      </activation>
+      <properties>
+        <maven.compiler.source>${maven.compiler.target}</maven.compiler.source>

Review Comment:
   We cannot mix `-source` and `--release` when invoking `javac` ([tool 
documentation](https://docs.oracle.com/en/java/javase/25/docs/specs/man/javac.html#option-release)).
 The version 3 of the compiler plugin had some build-in logic for choosing 
which option to use. But in version 4, this logic has been removed. The 
rational are:
   
   * One goal of version 4 of the compiler plugin is to reduce the amount of 
heuristic rules and be more straightforward in the arguments passed to `javac`.
   * Since Maven 4 can be executed only on Java 17 or later, the `--release` 
option can be used unconditionally, except when using toolchains or forked 
compiler. So we could start forgetting about `-source`.
   * There is a risk of ambiguity if both `<release>` and `<source>` are 
specified with inconsistent values. I presume that this is the reason why 
`javac` rejects the case where the two options are specified.



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