Uploaded image for project: 'Maven Wrapper'
  1. Maven Wrapper
  2. MWRAPPER-111

Failed to validate Maven Wrapper SHA-256 when properties file contains CRLF line endings

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.2.0
    • None
    • Maven Wrapper Scripts
    • None

    Description

      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.

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jakub.stroleny Jakub Stroleny
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: