Add user friendly error when Java < 17 is used

Add an enforcer rule with a custom message to detect if the JVM version is too old
This commit is contained in:
Brian Demers 2023-03-29 13:18:00 -04:00 committed by Dave Syer
parent 0962ed7e8f
commit 7b1abb3ca9

20
pom.xml
View file

@ -129,6 +129,26 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-java</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireJavaVersion>
<message>This build requires at least Java ${java.version}, update your JVM, and run the build again</message>
<version>${java.version}</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>