Skip to content

Commit

Permalink
Add user friendly error when Java < 17 is used
Browse files Browse the repository at this point in the history
Add an enforcer rule with a custom message to detect if the JVM version is too old
  • Loading branch information
bdemers authored and dsyer committed Apr 13, 2023
1 parent 0962ed7 commit 7b1abb3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 7b1abb3

Please sign in to comment.