This is an automated email from the ASF dual-hosted git repository.

cstamas pushed a commit to branch MWRAPPER-103-take2
in repository https://gitbox.apache.org/repos/asf/maven-wrapper.git

commit 2e8fb9fc2e312bba2b56060c7d16585c6296be8f
Author: Tamas Cservenak <[email protected]>
AuthorDate: Wed Apr 17 14:21:18 2024 +0200

    [MWRAPPER-103] Apply recommended workaround
    
    ---
    
    https://issues.apache.org/jira/browse/MWRAPPER-103
---
 maven-wrapper-distribution/src/resources/mvnw.cmd | 1 +
 1 file changed, 1 insertion(+)

diff --git a/maven-wrapper-distribution/src/resources/mvnw.cmd 
b/maven-wrapper-distribution/src/resources/mvnw.cmd
index fe570a9..e381339 100644
--- a/maven-wrapper-distribution/src/resources/mvnw.cmd
+++ b/maven-wrapper-distribution/src/resources/mvnw.cmd
@@ -160,6 +160,7 @@ FOR /F "usebackq tokens=1,2 delims==" %%A IN 
("%MAVEN_PROJECTBASEDIR%\.mvn\wrapp
 )
 IF NOT %WRAPPER_SHA_256_SUM%=="" (
     powershell -Command "&{"^
+       "Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function 
Get-FileHash"^
        "$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm 
SHA256).Hash.ToLower();"^
        "If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^
        "  Write-Error 'Error: Failed to validate Maven wrapper SHA-256, your 
Maven wrapper might be compromised.';"^

Reply via email to