Repository navigation
build(ci): pin Maven to 3.10.0 via the Maven Wrapper - #289
Conversation
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.
|
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 |
bjagg
left a comment
There was a problem hiding this comment.
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.
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
mvnw,mvnw.cmd,.mvn/wrapper/maven-wrapper.properties.mvn -B packageto./mvnw -B package..gitignorenegation so.mvn/wrapper/maven-wrapper.propertiesis tracked (a global~/.gitignorecommonly ignores.mvn).Verification
./mvnw -v→ Apache Maven 3.9.16 on Java 11../mvnw -B package→ BUILD SUCCESS locally on Java 11.Notes