Skip to content

Commit 887ca6e

Browse files
committed
ci: add Java 17 version verification in PR workflow
1 parent c1d5626 commit 887ca6e

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

.github/workflows/maven-pulls.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ jobs:
2727
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
2828
restore-keys: |
2929
${{ runner.os }}-maven-
30+
- name: Verify Java version
31+
run: |
32+
java -version
33+
export MY_JAVA_VERSION=`java -version 2>&1 | head -1 | cut -d'"' -f2 | sed '/^1\./s///' | cut -d'.' -f1`
34+
echo "Detected Java version: ${MY_JAVA_VERSION}"
35+
if [[ ${MY_JAVA_VERSION} -lt 17 ]]; then
36+
echo "Error: Java 17 or higher is required"
37+
exit 1
38+
fi
3039
- name: Build with Maven
3140
run: |
3241
mvn --no-transfer-progress -B verify --file pom.xml

0 commit comments

Comments
 (0)