Skip to content

build(ci): pin Maven to 3.10.0 via the Maven Wrapper - #289

Merged
Naenyn merged 2 commits into
uPortal-Project:masterfrom
Naenyn:build/pin-maven-wrapper
Nov 14, 2026
Merged

Naenyn merged 2 commits into
uPortal-Project:masterfrom
Naenyn:build/pin-maven-wrapper

Conversation

@Naenyn

@Naenyn Naenyn commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Update: the pin was moved from 3.9.16 to 3.10.0 and distributionSha256Sum was added (1f6d9909266510f039f59aa0e13dcd2c66da85f043e56276e41f2918f8bddaff, checked against Apache's published sha512). The verification below was done on 3.9.16; CI on this PR now runs on 3.10.0.

Problem

CI runs a bare mvn -B package, so it uses whatever Maven the GitHub runner image ships — a version that drifts over time. A recent runner Maven bump has been breaking builds across the uPortal portlets. Maven 4 is not a viable target here: it requires Java 17 to run, while this portlet targets Java 11.

Change

  • Add the Maven Wrapper pinned to 3.9.16 (latest Java-11-compatible line): mvnw, mvnw.cmd, .mvn/wrapper/maven-wrapper.properties.
  • Switch CI from mvn -B package to ./mvnw -B package.
  • Add a repo .gitignore negation so .mvn/wrapper/maven-wrapper.properties is tracked (a global ~/.gitignore commonly ignores .mvn).

Verification

./mvnw -v → Apache Maven 3.9.16 on Java 11.
./mvnw -B package → BUILD SUCCESS locally on Java 11.

Notes

  • Same change as NewsReaderPortlet#448 and CalendarPortlet#429; these portlets share the same CI shape and Java 11 constraint. Part of a fleet-wide pass to insulate CI from runner Maven drift.

CI invoked the runner's ambient `mvn`, whose version drifts with the
GitHub runner images. Maven 4 is not a viable target: it requires Java 17
to run, while this portlet targets Java 11.

Add the Maven Wrapper pinned to 3.9.16 (latest Java-11-compatible line)
and switch CI to `./mvnw -B package` so the build uses a fixed,
reproducible Maven regardless of the runner default. A repo .gitignore
negation is added because a global ~/.gitignore commonly ignores .mvn.

Verified locally: ./mvnw -v -> Apache Maven 3.9.16 on Java 11;
./mvnw -B package -> BUILD SUCCESS.
@Naenyn

Naenyn commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up idea (not for this PR): the wrapper pins the Maven binary per-repo, which is necessarily per-repo since the Maven version is selected before any parent POM is read. The policy could be centralized though — a requireMavenVersion enforcer rule (e.g. [3.9,4.0)) in uportal-portlet-parent would make every descendant fail fast on an unsupported Maven (notably Maven 4, which needs Java 17). The parent already uses the enforcer plugin, so it'd slot in naturally and backstop the per-repo wrappers.

@bjagg bjagg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving — part of the ten-repo wrapper pass.

Per-repo checks that passed here specifically: 5 files changed; wrapperVersion=3.3.4, distributionType=only-script, Maven 3.9.16 from the canonical repo.maven.apache.org; mvnw committed with mode 100755 so ./mvnw is executable; no bare mvn left in any workflow in this repo; .gitignore negations correctly ordered so .mvn/wrapper/maven-wrapper.properties is actually tracked. I also ran Maven 3.9.16 model validation against this repo's current default branch — clean, so the pin isn't masking a POM problem here.

Full reasoning, including the 3.9.16-vs-3.10.0 comparison showing that the pin tolerates malformed POMs that newer Maven rejects, plus a suggested distributionSha256Sum and a note about release scripts still using bare mvn, is on uPortal-Project/AnnouncementsPortlet#379.

Pin the wrapper to Maven 3.10.0 and add distributionSha256Sum so the downloaded distribution is verified beyond TLS.
@Naenyn Naenyn changed the title build(ci): pin Maven to 3.9.16 via the Maven Wrapper build(ci): pin Maven to 3.10.0 via the Maven Wrapper Nov 14, 2026
@Naenyn
Naenyn merged commit 8994301 into uPortal-Project:master Nov 14, 2026
4 checks passed
@Naenyn
Naenyn deleted the build/pin-maven-wrapper branch November 14, 2026 01:38
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