Skip to content

Commit

Permalink
Add maven-enforcer-plugin to ensure that a valid JVM version is used (#…
Browse files Browse the repository at this point in the history
…683)

Signed-off-by: Ryan Emerson <[email protected]>
  • Loading branch information
ryanemerson authored Jan 22, 2024
1 parent 004c285 commit fbf5671
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
<keycloak.version>999.0.0-SNAPSHOT</keycloak.version>
<junit5.version>5.9.3</junit5.version>
<httpclient.version>4.5.14</httpclient.version>
<maven.enforcer.plugin.version>3.4.1</maven.enforcer.plugin.version>
<maven.surefire.plugin.version>3.1.2</maven.surefire.plugin.version>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.source>17</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.target>17</maven.compiler.target>
<encoding>UTF-8</encoding>
</properties>

Expand Down Expand Up @@ -123,6 +124,27 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${maven.enforcer.plugin.version}</version>
<executions>
<execution>
<id>enforce-java</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireJavaVersion>
<!-- Java 21 is not currently supported by Scala 2.12.x, so we enforce the previous LTS release Java 17 -->
<version>[${maven.compiler.source},18)</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down

0 comments on commit fbf5671

Please sign in to comment.