Skip to content

[MWRAPPER-111] Failed to validate Maven Wrapper SHA-256 when properties file contains CRLF line endings #307

@jira-importer

Description

@jira-importer

Jakub Stroleny opened MWRAPPER-111 and commented

The maven wrapper checksum validation fails if maven-wrapper.properties contains line endings with CRLF instead of LF, e.g. because git repository is checked out using git core.autocrlf=true property.

Steps to reproduce:

  1. Have git repository with maven wrapper generated for project which contains correct wrapperSha256Sum ** property in maven-wrapper.properties
  2. Clone/Checkout git repository with core.autocrlf git property set to true
  3. Check that maven-wrapper.properties file contains CRLF instead of original LF line endings
  4. Run e.g. $./mvnw clean package for project and let maven script to verify checksum; the executed script is batch file (mvnw.cmd) version, not powershell version (not sure if it works with ps script)

Expected result:
The maven execution validates correct checksum with no issue.

Actual Result:
Following error is produced and execution stops.

$ ./mvnw clean package
Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.
Investigate or delete .mvn/wrapper/maven-wrapper.jar to attempt a clean download.
If you updated your Maven version, you need to update the specified wrapperSha256Sum property.

 

 


Affects: 3.2.0

Remote Links:

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpriority:majorMajor loss of function

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions