Skip to content

Commit 73593f8

Browse files
Add steps to install Maven explicitly (#10315)
Use MVN_VERSION=3.9.9
1 parent c6b7d6c commit 73593f8

File tree

5 files changed

+31
-4
lines changed

5 files changed

+31
-4
lines changed

.github/actions/common/action.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ inputs:
5454
setup-latest-java:
5555
description: Whether to setup latest stable java version
5656
default: 'false'
57+
setup-maven:
58+
description: Wheter to setup Maven
59+
default: 'true'
5760
runs:
5861
using: "composite"
5962
steps:
@@ -81,6 +84,25 @@ runs:
8184
echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"
8285
git config --global core.autocrlf false
8386
git config --global core.eol lf
87+
- if: ${{ inputs.setup-maven == 'true' }}
88+
name: Cache Maven Installation
89+
uses: actions/[email protected]
90+
with:
91+
path: .tools/apache-maven-*/**
92+
enableCrossOsArchive: true
93+
key: tools-maven-${{ hashFiles('.tools/apache-maven-*/**') }}
94+
restore-keys: |
95+
tools-maven-
96+
- if: ${{ inputs.setup-maven == 'true' && runner.os != 'Windows' }}
97+
name: Set up Maven
98+
shell: bash
99+
run: |
100+
if [ -z "${MVN_VERSION}" ] ; then echo "MVN_VERSION not set"; exit 1 ; fi
101+
if [ ! -d .tools/apache-maven-${MVN_VERSION}/bin ] ; then
102+
curl -O https://archive.apache.org/dist/maven/maven-3/${MVN_VERSION}/binaries/apache-maven-${MVN_VERSION}-bin.zip
103+
unzip apache-maven-${MVN_VERSION}-bin.zip -d .tools
104+
fi
105+
echo ${PWD}/.tools/apache-maven-${MVN_VERSION}/bin >> "${GITHUB_PATH}"
84106
- name: Set up GraalVM
85107
if: ${{ inputs.native-image == 'true' }}
86108
uses: graalvm/[email protected]

.github/workflows/nightly.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ on:
2020
- cron: '0 10 * * 0-6'
2121

2222
env:
23+
MVN_VERSION: 3.9.9
2324
MVN_ARGS: |
2425
-B -fae -e
2526
-Dmaven.wagon.httpconnectionManager.ttlSeconds=60

.github/workflows/release.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ on:
2020
branches: [ 'release-*' ]
2121

2222
env:
23-
JAVA_VERSION: '21'
24-
JAVA_DISTRO: 'oracle'
23+
MVN_VERSION: 3.9.9
24+
JAVA_VERSION: 21
25+
JAVA_DISTRO: oracle
2526
MVN_ARGS: |
2627
-B -e
2728
-Dmaven.wagon.httpconnectionManager.ttlSeconds=60

.github/workflows/snapshot.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ on:
2323
- 'helidon-*.x'
2424

2525
env:
26-
JAVA_VERSION: '21'
27-
JAVA_DISTRO: 'oracle'
26+
MVN_VERSION: 3.9.9
27+
JAVA_VERSION: 21
28+
JAVA_DISTRO: oracle
2829
MVN_ARGS: |
2930
-B -e
3031
-Dmaven.wagon.httpconnectionManager.ttlSeconds=60

.github/workflows/validate.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ on:
2929
default: ''
3030

3131
env:
32+
MVN_VERSION: 3.9.9
3233
JAVA_VERSION: 21
3334
GRAALVM_VERSION: 21.0.3
3435
JAVA_DISTRO: oracle
@@ -88,6 +89,7 @@ jobs:
8889
build-cache: read-write
8990
maven-cache: read-write
9091
run: |
92+
mvn --version
9193
mvn ${MVN_ARGS} build-cache:go-offline
9294
mvn ${MVN_ARGS} -T8 \
9395
-Dorg.slf4j.simpleLogger.showThreadName=true \

0 commit comments

Comments
 (0)