Skip to content

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

Open
Naenyn wants to merge 1 commit into
uPortal-Project:masterfrom
Naenyn:build/pin-maven-wrapper
Open

Naenyn wants to merge 1 commit into
uPortal-Project:masterfrom
Naenyn:build/pin-maven-wrapper

Conversation

@Naenyn

@Naenyn Naenyn commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

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.

This branch has not been deployed

No deployments
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