The starter parent of Spring Boot explicitly sets a property java.version
.
<properties>
<java.version>17</java.version>
<resource.delimiter>@</resource.delimiter>
<maven.compiler.release>${java.version}</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring-boot.run.main-class>${start-class}</spring-boot.run.main-class>
</properties>
Using this name for a property hinders your users to use the system property java.version
set by the used virtual machine for checks and validations.
Please consider to use a different property name for Spring Boot 4.
Comment From: wilkinsona
I think I understand the issue but I don't find the following to be sufficient justification for making a breaking change:
Using this name for a property hinders your users to use the system property java.version set by the used virtual machine for checks and validations.
Can you please provide some concrete examples of how it is a hinderance?
The java.version
property has been there since the first milestone twelve years ago. Perhaps something's changed in the Maven landscape such that it's now more of a problem? If so, please provide some details there too.
Comment From: obfischer
I noticed this problem when trying to use this property for a report and earlier then using it in messages for the Maven Enforcer Plugin.
I see the issue with changing such an important property.
Would it be an option to deprecate the usage of the property for now to to start using something like java-language-level
?