Skip to content

Conversation

@rhusar
Copy link
Member

@rhusar rhusar commented Jan 27, 2026

Mainly removed the binary from SCM that I detest.

Summary by Sourcery

Upgrade the Maven Wrapper to the latest script-based implementation and update the managed Maven distribution version.

Build:

  • Update Maven Wrapper scripts for Unix and Windows to wrapper version 3.3.4 and rely on script-only distribution instead of the Java downloader JAR.
  • Bump the Maven distribution used by the wrapper from 3.9.8 to 3.9.12 and remove the previously committed MavenWrapperDownloader.java helper.

@sourcery-ai
Copy link

sourcery-ai bot commented Jan 27, 2026

Reviewer's Guide

Updates the Maven wrapper to v3.3.4 with an "only-script" setup that no longer checks in the wrapper JAR, replaces both mvnw and mvnw.cmd with the new upstream scripts, bumps the managed Maven distribution to 3.9.12, and deletes the legacy Java-based wrapper downloader.

Sequence diagram for the updated Maven wrapper execution flow

sequenceDiagram
  actor Developer
  participant mvnw as mvnw_script
  participant Props as maven_wrapper_properties
  participant Repo as RemoteMavenRepo
  participant Cache as MavenDistributionCache
  participant Maven as MavenExecutable

  Developer->>mvnw: run mvnw [goals]
  mvnw->>Props: read distributionUrl, distributionSha256Sum
  mvnw->>Cache: check existing MAVEN_HOME for distributionUrl
  alt distribution present
    mvnw->>Maven: exec $MAVEN_HOME/bin/mvn [goals]
    Maven-->>Developer: build output
  else distribution missing
    mvnw->>Repo: download Maven distribution (zip/tar.gz)
    mvnw->>mvnw: optionally validate SHA-256
    mvnw->>Cache: extract distribution under ~/.m2/wrapper/dists
    mvnw->>Maven: exec new $MAVEN_HOME/bin/mvn [goals]
    Maven-->>Developer: build output
  end
Loading

Flow diagram for Maven wrapper bootstrap without checked-in JAR

flowchart TD
  A[Developer runs mvnw or mvnw.cmd] --> B[Read .mvn/wrapper/maven-wrapper.properties]
  B --> C{Existing MAVEN_HOME for distributionUrl?}
  C -->|Yes| D[Resolve MAVEN_HOME in ~/.m2/wrapper/dists]
  D --> E[Invoke MAVEN_HOME/bin/mvn or mvnd]
  E --> F[Execute build]

  C -->|No| G[Create temp download directory]
  G --> H[Download Maven distribution from distributionUrl
           using wget/curl/Java or WebClient]
  H --> I{distributionSha256Sum defined?}
  I -->|Yes| J[Validate SHA-256 checksum]
  J -->|OK| K[Extract archive into temp directory]
  J -->|Failed| X[Abort: checksum validation failed]
  I -->|No| K[Extract archive into temp directory]

  K --> L[Locate extracted distribution directory]
  L --> M[Move directory under ~/.m2/wrapper/dists as MAVEN_HOME]
  M --> E
  X --> Y[Exit with error]
Loading

File-Level Changes

Change Details Files
Replace Unix mvnw script with Maven Wrapper 3.3.4 shell implementation that self-downloads Maven distributions and no longer uses the Takari wrapper JAR.
  • Replace legacy mvnw startup script with the latest upstream 3.3.4 script including new argument parsing, Java detection, and error handling.
  • Adopt new logic for resolving distributionUrl and optional distributionSha256Sum from maven-wrapper.properties, including mvnd support and repository URL overrides.
  • Implement new download flow using wget, curl, or a small on-the-fly Java downloader, with checksum validation and support for zip/tar.gz artifacts.
  • Change wrapper installation layout to ~/.m2/wrapper/dists/... with hash-based subdirectories and direct exec of the unzipped Maven binary instead of invoking the wrapper JAR.
mvnw
Replace Windows mvnw.cmd with Maven Wrapper 3.3.4 PowerShell-enhanced implementation that bootstraps Maven without the wrapper JAR.
  • Replace batch-only mvnw.cmd with a hybrid Batch+PowerShell script that delegates wrapper logic to PowerShell and simply invokes the resolved mvn/mvnd command.
  • Add logic to read distributionUrl and optional distributionSha256Sum from maven-wrapper.properties, derive the appropriate mvn or mvnd command, and support MVNW_REPOURL overrides.
  • Implement download of the Maven distribution via .NET WebClient with optional basic auth, SHA-256 validation, and extraction into the ~/.m2/wrapper/dists layout.
  • Ensure the script finds the extracted Maven distribution directory (including snapshot cases) and outputs MVN_CMD for the batch layer to execute.
mvnw.cmd
Update Maven wrapper configuration to 3.3.4, switch to script-only mode, bump Maven distribution to 3.9.12, and remove the checked-in downloader Java class.
  • Update maven-wrapper.properties to set wrapperVersion=3.3.4, distributionType=only-script, and change distributionUrl to Apache Maven 3.9.12.
  • Remove wrapperUrl property since the wrapper JAR is no longer downloaded or used in only-script mode.
  • Delete MavenWrapperDownloader.java now that the wrapper scripts no longer rely on a Java-based downloader in the project tree.
.mvn/wrapper/maven-wrapper.properties
.mvn/wrapper/MavenWrapperDownloader.java

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant