@@ -12,32 +12,35 @@ jobs:
1212 pull-requests : write
1313 runs-on : ubuntu-latest
1414 steps :
15- - uses : actions/checkout@v4
15+ - uses : actions/checkout@v6
1616
1717 - uses : actions/setup-java@v5
1818 with :
1919 java-version : ' 21'
2020 distribution : ' temurin'
2121
2222 - name : Get latest Maven version
23- # This fetches latest Maven releas from maven.org - not the download page; it might be delayed a few days after releases.
24- # Note that the "gav" at the end of the URL ensures we use only generally available version. As of now, this is 3.x .
23+ # This fetches latest Maven release from maven.org - not the download page; it might be delayed a few days after releases.
24+ # Note that the "gav" at the end of the URL is necessary to retrieve more than one version. jq will filter out rc versions .
2525 id : maven
2626 run : |
27- LATEST=$(curl -s "https://search.maven.org/solrsearch/select?q=g:org.apache.maven+a:apache-maven&rows=1 &wt=json&core=gav" \
27+ LATEST=$(curl -s "https://search.maven.org/solrsearch/select?q=g:org.apache.maven+a:apache-maven&rows=20 &wt=json&core=gav" \
2828 | jq -r '[.response.docs[].v | select(test("^3\\.\\d+\\.\\d+$"))] | first')
2929 echo "version=$LATEST" >> $GITHUB_OUTPUT
3030
3131 - name : Update wrapper
3232 # Update Maven wrapper scripts AND maven-wrapper.properties.
3333 # Note that this removes the SHA from properties file.
34- run : ./mvnw wrapper:wrapper -Dmaven=${{ steps.maven.outputs.version }}
34+ env :
35+ VERSION : ${{ steps.maven.outputs.version }}
36+ run : ./mvnw wrapper:wrapper -Dmaven="${VERSION}"
3537
3638 - name : Patch SHA512 into wrapper properties
3739 # Add the SHA to properties file.
38- # We might need the -L for curl, as after a new release all old SHA files will move to .
40+ # We might need the -L for curl, as after a new release all old SHA files will move to archive folder.
41+ env :
42+ VERSION : ${{ steps.maven.outputs.version }}
3943 run : |
40- VERSION=${{ steps.maven.outputs.version }}
4144 MAJOR=$(echo "$VERSION" | cut -d. -f1)
4245 SHA=$(curl -sL "https://downloads.apache.org/maven/maven-${MAJOR}/${VERSION}/binaries/apache-maven-${VERSION}-bin.zip.sha512")
4346 PROPS=".mvn/wrapper/maven-wrapper.properties"
0 commit comments