Enforce build using JDK >= 11 (#2333)
Building already requires JDK >= 11, but previously using a lower JDK version such as JDK 8 would lead to cryptic build errors because some compiler flags are unsupported. Using the Maven Enforcer Plugin makes sure that the build fails early with a somewhat better to understand error message.
This commit is contained in:
parent
19983737ae
commit
ef35a34a60
31
pom.xml
31
pom.xml
|
@ -86,6 +86,31 @@
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-enforcer-plugin</artifactId>
|
||||||
|
<version>3.2.1</version>
|
||||||
|
<executions>
|
||||||
|
<!-- Enforce that correct JDK version is used to avoid cryptic build errors -->
|
||||||
|
<execution>
|
||||||
|
<id>enforce-jdk-version</id>
|
||||||
|
<goals>
|
||||||
|
<goal>enforce</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<rules>
|
||||||
|
<requireJavaVersion>
|
||||||
|
<!-- Other plugins of this build require at least JDK 11 -->
|
||||||
|
<version>[11,)</version>
|
||||||
|
</requireJavaVersion>
|
||||||
|
</rules>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
|
||||||
<pluginManagement>
|
<pluginManagement>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
@ -121,9 +146,6 @@
|
||||||
<version>2.18.0</version>
|
<version>2.18.0</version>
|
||||||
</path>
|
</path>
|
||||||
</annotationProcessorPaths>
|
</annotationProcessorPaths>
|
||||||
<jdkToolchain>
|
|
||||||
<version>[11,)</version>
|
|
||||||
</jdkToolchain>
|
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
@ -131,9 +153,6 @@
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
<version>3.5.0</version>
|
<version>3.5.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<jdkToolchain>
|
|
||||||
<version>[11,)</version>
|
|
||||||
</jdkToolchain>
|
|
||||||
<!-- Specify newer JDK as target to allow linking to newer Java API, and to generate
|
<!-- Specify newer JDK as target to allow linking to newer Java API, and to generate
|
||||||
module overview in Javadoc for Gson's module descriptor -->
|
module overview in Javadoc for Gson's module descriptor -->
|
||||||
<release>11</release>
|
<release>11</release>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user