-
Notifications
You must be signed in to change notification settings - Fork 69
[MWRAPPER-117] added distributionSha512Sum and wrapperSha512Sum #398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[MWRAPPER-117] added distributionSha512Sum and wrapperSha512Sum #398
Conversation
…erification with SHA-512 since Maven only publishes the SHA-512 checksum and not the SHA-256 checksum
Is this potential deprecation tracked? I ask because it may be lost and I wonder if we can add that as a log as part of this change? |
This link confused me because that's about the wrapper. I think that you meant to share something like https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.9.12/ where each distribution after 3.9.0 has a |
| exit 1 | ||
| fi | ||
| if [ $distributionSha512Result = false ]; then | ||
| echo "Error: Failed to validate Maven distribution SHA-512, your Maven distribution might be compromised." >&2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run-on sentence
| distributionSha512Result=true | ||
| fi | ||
| else | ||
| echo "Checksum validation was requested but neither 'sha512sum' or 'shasum' are available." >&2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or --> nor
| fi | ||
| else | ||
| echo "Checksum validation was requested but neither 'sha512sum' or 'shasum' are available." >&2 | ||
| echo "Please install either command, or disable validation by removing 'distributionSha512Sum' from your maven-wrapper.properties." >&2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no Please
| $distributionSha512Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha512Sum | ||
| if ($distributionSha512Sum) { | ||
| if ($USE_MVND) { | ||
| Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha512Sum' from your maven-wrapper.properties." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove nPlease
| } | ||
| Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash | ||
| if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA512).Hash.ToLower() -ne $distributionSha512Sum) { | ||
| Write-Error "Error: Failed to validate Maven distribution SHA-512, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha512Sum property." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run-on sentence
|
Windows seems failing? |
added distributionSha512Sum and wrapperSha512Sum for verification with SHA-512 since Maven only publishes the SHA-512 checksum and not the SHA-256 checksum.
The wrapper SHA-512 is pulished on https://maven.apache.org/tools/wrapper/download.cgi
The distribution SHA-512 is published on https://maven.apache.org/download.cgi
The SHA-256 option is still available for backward compatibility. However this could be marked deprecated and removed in future versions since Maven doesn't publish the SHA-256 checksums.
Following this checklist to help us incorporate your
contribution quickly and easily:
Note that commits might be squashed by a maintainer on merge.
This may not always be possible but is a best-practice.
mvn verifyto make sure basic checks pass.A more thorough check will be performed on your pull request automatically.
mvn -Prun-its verify).If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.