Skip to content

[FLINK-40459][Build/Shaded] Bump Maven from 3.8.6 to 3.9.16 - #170

Merged
MartijnVisser merged 1 commit into
apache:masterfrom
MartijnVisser:FLINK-40459-maven-version
Aug 26, 2026
Merged

[FLINK-40459][Build/Shaded] Bump Maven from 3.8.6 to 3.9.16#170
MartijnVisser merged 1 commit into
apache:masterfrom
MartijnVisser:FLINK-40459-maven-version

Conversation

@MartijnVisser

@MartijnVisser MartijnVisser commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

What

Bump the build and enforced Maven version from 3.8.6 to 3.9.16, matching apache/flink#29009 for FLINK-40459, and add a Maven wrapper so CI and local builds share one pin.

Why

Maven 3.9 renders mojo banners using the plugin's goal prefix (deploy:2.8.2:deploy) instead of its artifactId (maven-deploy-plugin:2.8.2:deploy). flink-ci-tools' DeployParser and DependencyParser match on the artifactId spelling, so under 3.9.16 they match nothing, NoticeFileChecker sees zero deployed modules, and the NOTICE check degrades to a no-op that still exits 0 — a green build that checked nothing:

Build exit Extracted N modules that were deployed
3.8.6 0 17
3.9.16, unremediated 0 0
3.9.16 + this PR 0 17

No released flink-ci-tools fixes this — I checked the 1.18.0, 1.20.4 and 2.2.1 jars on Central — so CI rewrites the two affected banners back to the 3.8 spelling before invoking the checker. ShadeParser is unaffected; its regex already starts with .*.

Changes

  • .mvn/wrapper/maven-wrapper.properties, mvnw, mvnw.cmd — wrapper pinning Maven 3.9.16 (maven-wrapper 3.3.4), matching Flink's. Added script-only: maven-wrapper.jar is not checked in, so no binary enters the ASF source release; mvnw fetches it on first use and verifies wrapperSha256Sum. The earlier attempt here (0a4baad) checked the jar in and was reverted 18 minutes later.
  • .github/workflows/ci.yml — build through ./mvnw, drop the stCarolas/setup-maven step, and normalize the two mojo banners before the license check. The workflow now contains no Maven version at all: maven-wrapper.properties is the single pin. Drop the normalization step once flink-ci-tools ships the FLINK-40459 parser fix.
  • pom.xml — the release profile's requireMavenVersion pin [3.8.6][3.9.16].
  • .gitignore / README.md — ignore the downloaded wrapper jar; document the required Maven version.

Release scripts under tools/releasing/ keep using the system mvn.

Verification

Differential build of the full reactor under both Maven versions, on JDK 11 and 17, across the default, -Pinclude-netty-tcnative-static, -Plicense-check, -Dshade-sources and -Prelease profiles:

  • Every deployed artifact is identical entry-for-entry and by SHA-256 per uncompressed entry — META-INF/NOTICE, META-INF/DEPENDENCIES and the dependency-reduced/flattened poms included. The only difference anywhere is the manifest Created-By: Apache Maven 3.8.63.9.16 and the matching pom.properties comment; the three Ant-repackaged netty/tcnative jars are unchanged, as expected.
  • Resolution is unchanged: two independent cold local repositories are identical in all 2189 files, and dependency:tree / dependency:list match exactly.
  • Downstream, flink-rpc/flink-rpc-akka built against each artifact set with the same Maven gives uber-jars identical in all 12323 entries.

Per-commit detail, including the old plugin set's behaviour under 3.9.16 and the negative controls, is in the commit message.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Code (Claude Opus 5)

Aligns flink-shaded with apache/flink#29009, which moves the Flink build
from Maven 3.8.6 to 3.9.16.

  - .mvn/wrapper/maven-wrapper.properties, mvnw, mvnw.cmd: add a Maven wrapper
    pinning Apache Maven 3.9.16 (maven-wrapper 3.3.4), matching Flink's
  - .github/workflows/ci.yml: build through ./mvnw and drop the
    stCarolas/setup-maven step
  - pom.xml: the release profile's requireMavenVersion pin [3.8.6] -> [3.9.16]
  - README.md: document the required Maven version and the wrapper

CI builds through the wrapper rather than installing Maven separately, so the
version has a single source of truth in maven-wrapper.properties instead of
being pinned in both that file and the workflow, where the two could drift.
This also removes the dependency on stCarolas/setup-maven, an unmaintained
third-party action, and means CI exercises the wrapper's own SHA-256
verification of the downloaded distribution. Release scripts under
tools/releasing/ keep using the system mvn.

The wrapper is added script-only: maven-wrapper.jar is deliberately not
checked in. mvnw downloads it on first use and verifies it against
wrapperSha256Sum, so no binary artifact enters the ASF source release and
apache-rat reports 0 binaries / 0 unapproved files.

Maven 3.9 prints mojo banners using the plugin's goal prefix
("deploy:2.8.2:deploy") instead of its artifactId
("maven-deploy-plugin:2.8.2:deploy"). flink-ci-tools' DeployParser and
DependencyParser match on the artifactId spelling, so under 3.9.16 they match
nothing, NoticeFileChecker sees zero deployed modules, and the NOTICE check
degrades to a no-op that still exits 0. No released flink-ci-tools contains
the fix (verified against 1.18.0, 1.20.4 and 2.2.1), so CI normalizes the two
affected banners back to the 3.8 spelling before invoking the checker. That
step is a no-op on 3.8-format logs and should be removed once flink-ci-tools
ships the FLINK-40459 parser fix.

Validated with a differential build of the full reactor under both 3.8.6 and
3.9.16 on JDK 11 and JDK 17, across the default, -Pinclude-netty-tcnative-static,
-Plicense-check, -Dshade-sources and -Prelease profile combinations. Every
deployed artifact is identical entry-for-entry and content-for-content; the
only difference anywhere is the MANIFEST "Created-By: Apache Maven" line and
the corresponding pom.properties comment. The three Ant-repackaged netty and
tcnative jars are unchanged, as expected. Dependency resolution is unchanged:
two independent cold local repositories are byte-identical, and dependency:tree
and dependency:list match exactly.

Generated-by: Claude Code (Claude Opus 5)
@MartijnVisser
MartijnVisser force-pushed the FLINK-40459-maven-version branch from 5720ab1 to 2c296c9 Compare August 25, 2026 15:53
@MartijnVisser
MartijnVisser merged commit 823710e into apache:master Aug 26, 2026
1 check passed
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.

2 participants