Skip to content

Check hashes by default #413

Open
Open

Description

@elharo

New feature, improvement proposal

From docs

Checksum verification of downloaded binaries

To avoid supply-chain-attacks by downloading a corrupted artifact, it
is possible to specify checksums for both the maven-wrapper.jar and
the downloaded distribution. To apply verification, add the expected
file's SHA-256 sum in hex notation, using only small caps, to
maven-wrapper.properties. The property for validating the
maven-wrapper.jar file is named wrapperSha256Sum whereas the
distribution file property is named distributionSha256Sum.

Given the increasing frequency and sophistication of supply chain attacks, we should probably just do this by default.

Activity

  1. added
    enhancement
    on Apr 13, 2026
  2. delanym commented on Nov 16, 2026

    @delanym

    @elharo is it an idea to always check the hash even if its downloaded already?

    I already had ~/.m2/wrapper/dists/apache-maven-3.10.1

    then I changed the

    diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties
    index 058db7bcd53..02390751dfc 100644
    --- a/.mvn/wrapper/maven-wrapper.properties
    +++ b/.mvn/wrapper/maven-wrapper.properties
    @@ -4 +4 @@ distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-mav
    -distributionSha256Sum=9c1ef9174ef250a5009ed0dec97cbe8699acf7479add4e62bf7b0ea791c0adb5
    +distributionSha256Sum=9c

    and then next build succeeded.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions