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

Include SHA256 from Maven distribution into the maven-wrapper.properties #1577

Closed
mhalbritter opened this issue Oct 16, 2024 · 2 comments
Closed
Assignees

Comments

@mhalbritter
Copy link
Contributor

mhalbritter commented Oct 16, 2024

The maven wrapper supports checking the SHA256 sum of the downloaded maven distribution. To harden security we should put the sha256 hash into maven-wrapper.properties.

@mhalbritter
Copy link
Contributor Author

We're now including the sha256 of the Maven zip. I've also added tests to detect when we mess up that SHA checksum somehow.

@cdelashmutt-pivotal
Copy link

Actually, I think there may be a problem with this. It looks like the current Maven Wrapper script that is generated for Maven 3.9.9, includes some logic starting at line 175 that will switch the downloaded file type from .zip to .tar.gz if the unzip command isn't found in the environment you are running mvnw on. (https://github.com/apache/maven-wrapper/blob/maven-wrapper-3.3.2/maven-wrapper-distribution/src/resources/only-mvnw#L175-L179)

This means that the included SHA256 might be wrong when the download URL for the binaries for Maven gets switched to .tar.gz.

It ultimately seems like this might be a deficiency in the Maven wrapper, since it doesn't seem to me that you can specify SHA256 sums for both of the possible downloads that could occur (one for .tar.gz and one for .zip).

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

No branches or pull requests

2 participants