Skip to content

Commit

Permalink
Add user friendly error when Java < 17 is used (Issue #280) (#286)
Browse files Browse the repository at this point in the history
* Add user friendly error when Java < 17 is used (Issue #280)
* pom.xml updated
* java version property updated
* Removed Bracket [Issue #280] fixed build
  • Loading branch information
AnkushThakur27 authored Nov 14, 2024
1 parent 06a9bac commit f2c1422
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down Expand Up @@ -127,6 +127,38 @@
<failOnUnableToExtractRepoInfo>false</failOnUnableToExtractRepoInfo>
</configuration>
</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>
🚫 Java version error: This project requires Java ${java.version} or higher.

Your current Java version is ${java.version}
To fix this:
1. Download and install Java 17 or higher from your preferred vendor
2. Make sure JAVA_HOME points to the new Java installation
3. Verify with 'java -version' command
4. Run the build again

For more information, check the project documentation.
</message>
<version>${java.version})</version>
</requireJavaVersion>
</rules>
<failFast>true</failFast>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Expand Down

0 comments on commit f2c1422

Please sign in to comment.