Skip to content

Commit 69b9415

Browse files
committed
Download mvnw from Google mirror instead of Maven Central
1 parent cb50d57 commit 69b9415

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

.github/actions/setup/action.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,26 +111,29 @@ runs:
111111
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
112112
restore-keys: |
113113
${{ runner.os }}-maven-
114+
- name: Prefer Google Maven Central for Maven wrapper
115+
shell: bash
116+
run: echo "MVNW_REPOURL=https://maven-central.storage-download.googleapis.com/maven2" >> "${GITHUB_ENV}"
114117
- name: Cache and Restore Maven wrapper
115118
id: cache-maven-wrapper
116119
if: ${{ format('{0}', inputs.cache) == 'true' }}
117120
uses: actions/cache@v5
118121
with:
119122
# Note: must be same set of paths as for cache:restore mode
120123
path: ~/.m2/wrapper/dists
121-
key: ${{ runner.os }}-maven-wrapper-${{ hashFiles('.mvn/wrapper/maven-wrapper.properties') }}
124+
key: ${{ runner.os }}-maven-wrapper-google-maven-central-${{ hashFiles('.mvn/wrapper/maven-wrapper.properties') }}
122125
restore-keys: |
123-
${{ runner.os }}-maven-wrapper-
126+
${{ runner.os }}-maven-wrapper-google-maven-central-
124127
- name: Restore Maven wrapper
125128
id: cache_restore-maven-wrapper
126129
if: ${{ format('{0}', inputs.cache) == 'restore' }}
127130
uses: actions/cache/restore@v5
128131
with:
129132
# Note: must be same set of paths as for cache:true mode
130133
path: ~/.m2/wrapper/dists
131-
key: ${{ runner.os }}-maven-wrapper-${{ hashFiles('.mvn/wrapper/maven-wrapper.properties') }}
134+
key: ${{ runner.os }}-maven-wrapper-google-maven-central-${{ hashFiles('.mvn/wrapper/maven-wrapper.properties') }}
132135
restore-keys: |
133-
${{ runner.os }}-maven-wrapper-
136+
${{ runner.os }}-maven-wrapper-google-maven-central-
134137
- name: Verify Maven wrapper
135138
if: ${{ inputs.java-version != '' }}
136139
shell: bash

0 commit comments

Comments
 (0)