Skip to content

Commit

Permalink
Adjust Maven property file to use the same variable names as the offi…
Browse files Browse the repository at this point in the history
…cial distribution.
  • Loading branch information
raphw committed Dec 7, 2024
1 parent 7d42756 commit 4cecff9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar
wrapperHash=3d8f20ce6103913be8b52aef6d994e0c54705fb527324ceb9b835b338739c7a8
wrapperSha256Sum=3d8f20ce6103913be8b52aef6d994e0c54705fb527324ceb9b835b338739c7a8
distributionSha256Sum=4ec3f26fb1a692473aea0235c300bd20f0f9fe741947c82c1234cefd76ac3a3c
8 changes: 4 additions & 4 deletions mvnw
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,13 @@ else
fi

# Validate the Maven wrapper's hash (Byte Buddy edit)
wrapperHash=""
wrapperSha256Sum=""
while IFS="=" read key value; do
case "$key" in (wrapperHash) wrapperHash=$value; break ;;
case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;;
esac
done < "$BASE_DIR/.mvn/$wrapperLocation/maven-wrapper.properties"
if [ -n "$wrapperHash" ]; then
if ! echo "$wrapperHash $BASE_DIR/.mvn/$wrapperLocation/maven-wrapper.jar" | shasum -a 256 -c > /dev/null; then
if [ -n "$wrapperSha256Sum" ]; then
if ! echo "$wrapperSha256Sum $BASE_DIR/.mvn/$wrapperLocation/maven-wrapper.jar" | shasum -a 256 -c > /dev/null; then
echo "Could not validate hash of maven-wrapper.jar";
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion mvnw.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ if exist %WRAPPER_JAR% (
@REM Validate the Maven wrapper's hash (Byte Buddy edit)
SET FILE_HASH=""
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\%WRAPPER_LOCATION%\maven-wrapper.properties") DO (
IF "%%A"=="wrapperHash" SET FILE_HASH=%%B
IF "%%A"=="wrapperSha256Sum" SET FILE_HASH=%%B
)
IF NOT %FILE_HASH%=="" (
powershell -Command "&{"^
Expand Down

0 comments on commit 4cecff9

Please sign in to comment.