Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[MWRAPPER-103] Workaround: demote check to Warning#131

Closed
cstamas wants to merge 2 commits into
masterfrom
MWRAPPER-103
Closed

[MWRAPPER-103] Workaround: demote check to Warning#131
cstamas wants to merge 2 commits into
masterfrom
MWRAPPER-103

Conversation

@cstamas
Copy link
Copy Markdown
Member

@cstamas cstamas commented Apr 17, 2024

For start, instead to die off, let's demote the failure to warning level.


https://issues.apache.org/jira/browse/MWRAPPER-103

For start, instead to die off, let's demote the failure to
warning level.

---

https://issues.apache.org/jira/browse/MWRAPPER-103
@cstamas
Copy link
Copy Markdown
Member Author

cstamas commented Apr 17, 2024

@gsmet eyes please. Disclaimer: I am not Win guy, so if you can bring on someone to verify, please do so.

@cstamas
Copy link
Copy Markdown
Member Author

cstamas commented Apr 17, 2024

@jorsol eyes please

On Windows the error was demoted to Warning.
@jorsol
Copy link
Copy Markdown
Contributor

jorsol commented Apr 17, 2024

The issue affects the wrapperSha256Sum from mvnw, not only-mvnw, actually the only-mvnw does not validate the wrapperSha256Sum since it doesn't download the jar.

In the end, this is not the fix for the issue reported, the trouble is that only-mvnw does different things than mvnw, so it seems that using only-mvnw works and mvnw don't.

@cstamas
Copy link
Copy Markdown
Member Author

cstamas commented Apr 17, 2024

Oh, got it now. Ok, am closing this one out then, as I missed the topic.

@cstamas cstamas closed this Apr 17, 2024
@cstamas cstamas deleted the MWRAPPER-103 branch April 17, 2024 12:14
@jorsol
Copy link
Copy Markdown
Contributor

jorsol commented Apr 17, 2024

Since the default is now only-mvnw, maybe the current workaround is to simply remove the lines from:

@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file
SET WRAPPER_SHA_256_SUM=""
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B
)
IF NOT %WRAPPER_SHA_256_SUM%=="" (
powershell -Command "&{"^
"$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.';"^
" Write-Error 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^
" Write-Error 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^
" exit 1;"^
"}"^
"}"
if ERRORLEVEL 1 goto error
)

Or comment the if ERRORLEVEL 1 goto error (not sure if this is enough).

@cstamas
Copy link
Copy Markdown
Member Author

cstamas commented Apr 17, 2024

Yup, that is my problem as well: "not sure" 😄

@cstamas
Copy link
Copy Markdown
Member Author

cstamas commented Apr 17, 2024

Next attempt: #132

@jira-importer
Copy link
Copy Markdown

Resolve #292

1 similar comment
@jira-importer
Copy link
Copy Markdown

Resolve #292

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants