Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH Issue 70 - mvnw file from Windows not executable #71

Merged
merged 2 commits into from
Jul 23, 2021

Conversation

pivotal-david-osullivan
Copy link
Contributor

Summary

Resolves #70

Use Cases

An mvnw file with Windows line endings (CRLF) will cause the build in a linux container to fail due to the unrecognised formatting. The error appears as a file not found:

fork/exec /workspace/source/app/mvnw: no such file or directory

This PR adds a function which converts CRLF endings to LF so that the mvnw file can be executed successfully.

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

Added function to convert CRLF formatting to LF in the mvnw file

Added function to convert CRLF formatting to LF in the mvnw file

Added function to convert CRLF formatting to LF in the mvnw file
@pivotal-david-osullivan pivotal-david-osullivan requested a review from a team July 23, 2021 10:12
@dmikusa dmikusa added semver:patch A change requiring a patch version bump type:bug A general bug labels Jul 23, 2021
maven/build.go Show resolved Hide resolved
maven/build.go Outdated Show resolved Hide resolved
* Moved mvnw file processing/cleaning to a separate function
* Changed util function used from bytes.Replace to bytes.ReplaceAll for simplicity
* Removed check on whether CRLF is present in file
* Changed test to call the new function only

[Resolves paketo-buildpacks#70]
@dmikusa dmikusa merged commit 93637e5 into paketo-buildpacks:main Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:patch A change requiring a patch version bump type:bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maven wrapper not executable when building on Windows
2 participants