Skip to content

Add support for the Maven Wrapper - #14812

Merged
v-kbukum1 merged 26 commits into
dependabot:mainfrom
yeikel:maven-wrapper
Aug 11, 2026
Merged

v-kbukum1 merged 26 commits into
dependabot:mainfrom
yeikel:maven-wrapper

Conversation

@yeikel

@yeikel yeikel commented Apr 24, 2026 •

Copy link
Copy Markdown
Contributor

What are you trying to accomplish?

This pull request adds first-class support for keeping the Maven Wrapper up to date. When a repository contains mvnw or mvnw.cmd, Dependabot can detect the wrapper configuration and update the Maven distribution, Maven Wrapper Plugin, generated scripts, and wrapper JAR.

The feature is gated behind the maven_wrapper_updater feature flag and remains off by default for a controlled rollout.

Dependencies tracked

Dependency Maven coordinate Version source
Apache Maven distribution org.apache.maven:apache-maven distributionUrl and optional distributionSha256Sum
Maven Wrapper Plugin org.apache.maven.wrapper:maven-wrapper wrapperVersion, wrapperUrl, or the generated script banner for affected wrapper formats

Tracking these separately lets users update them independently or combine them in a Dependabot group.

updates:
  - package-ecosystem: "maven"
    directory: "/"
    schedule:
      interval: "daily"
    groups:
      maven-wrapper:
        patterns:
          - "org.apache.maven.wrapper:maven-wrapper"
          - "org.apache.maven:apache-maven"

Implementation

  • Fetches wrapper properties, Unix and Windows scripts, and the wrapper JAR alongside Maven build files.
  • Parses root and nested wrapper configurations, including the Maven 3.3.0 script-banner version gap and the transitive-dependency parser path.
  • Regenerates wrapper artifacts through the Maven Wrapper Plugin using the system Maven installation.
  • Supports separate and grouped Maven/wrapper updates without dropping same-coordinate POM requirements.
  • Preserves executable modes, checksums, alwaysDownload / alwaysUnpack, Java-properties escapes, complete distribution URLs, and custom or private repository locations.
  • Treats HTTP 401 and 403 responses as private-registry authentication failures.
  • Skips an otherwise valid custom distribution whose filename does not expose a Maven version instead of aborting the entire Maven parse.

The design follows the Gradle Wrapper integration from #12891 while keeping the feature within the existing Maven ecosystem.

Rollout and service integration

The Dependabot service must allow the wrapper scripts and JAR in updated-dependency-files. End-to-end fixtures and the corresponding service-side integration coverage are tracked in dependabot/smoke-tests#466.

Validation

  • Maven CI: 851 examples, 0 failures.
  • Lint, Sorbet, integration, CodeQL, dependency review, and workflow security checks pass on the current PR head.
  • Added focused parser, updater, file-fetcher, grouping, custom-repository, checksum, persistence-flag, and unsupported-distribution tests.
  • Manually exercised against apache/dubbo, apache/logging-log4j2, and quarkusio/quarkus.

Fixes #485.
Fixes #13183.

@github-actions github-actions Bot added the L: java:maven Maven packages via Maven label Apr 24, 2026
@yeikel
yeikel marked this pull request as ready for review April 24, 2026 01:35
@yeikel
yeikel requested a review from a team as a code owner April 24, 2026 01:35
Comment thread .github/workflows/smoke.yml Dismissed
@yeikel
yeikel marked this pull request as draft April 24, 2026 04:58
@yeikel
yeikel force-pushed the maven-wrapper branch 14 times, most recently from e103b7f to 06930a3 Compare April 28, 2026 05:29
@yeikel
yeikel force-pushed the maven-wrapper branch 7 times, most recently from a087ca7 to 4d86964 Compare April 29, 2026 15:11
@v-kbukum1

v-kbukum1 commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

@yeikel , I think everything is good. Can we also fix the CI lint issue? Also note that you may need to update your smoke test fork so it can properly get up to date smoke tests.

@v-kbukum1

Copy link
Copy Markdown
Contributor

@yeikel , I think everything is good. Can we also fix the CI lint issue? Also note that you may need to update your smoke test fork so it can properly get up to date smoke tests.

@yeikel , I wanted to deploy this today but seems like we have conflict, do you have time to fix conflict today?

@yeikel

yeikel commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

@kbukum1 I resolved the merge conflicts

@v-kbukum1

Copy link
Copy Markdown
Contributor

@kbukum1 I resolved the merge conflicts

Thanks @yeikel. Hopefully today will ship this.

@v-kbukum1

Copy link
Copy Markdown
Contributor

@kbukum1 I resolved the merge conflicts

Thanks @yeikel. Hopefully today will ship this.

@yeikel , can we revert the smoke yaml changes. So accordingly our smoke tests can succeed? After if everything is alright, I will ship this.

v-kbukum1 and others added 2 commits August 11, 2026 17:51
Restore .github/workflows/smoke.yml to match main: drop the
maven-wrapper branch / yeikel/smoke-tests repo defaults that were used
for local smoke-testing during development.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4e34bbde-43a0-4b13-86ce-c263ec68aab0
@yeikel

yeikel commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

@kbukum1 I regenerated the tests: dependabot/smoke-tests#466

Thank you both for the feedback and moving this forward

Looking forward to seeing it in prod 🥳

@pzygielo

This comment was marked as outdated.

@pzygielo pzygielo mentioned this pull request Aug 13, 2026
1 task done
@yeikel

yeikel commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

Looking forward to seeing it in prod 🥳

Seeing this in prod.

Dependabot now creates files that did not exist in repository before (in my first case it's mvnw.cmd).

😞

@pzygielo Is this the issue you are seeing? #15913

Let's please move the discussion there

@pzygielo

This comment was marked as outdated.

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

Labels

L: java:maven Maven packages via Maven

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Support vendoring for Maven Maven Wrapper support

6 participants