[MWRAPPER-103] Apply recommended workaround (#132) · apache/maven-wrapper@3418360 (original) (raw)

File tree

Original file line number Diff line number Diff line change
@@ -123,6 +123,7 @@ if ($distributionSha256Sum) {
123 123 if ($USE_MVND) {
124 124 Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
125 125 }
126 + Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
126 127 if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
127 128 Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
128 129 }