Repository navigation
Conversation
CI invoked the runner's ambient `mvn`, whose version drifts with the GitHub runner images. Newer runner Maven started rejecting long-standing POM constructs (e.g. the duplicate maven-antrun-plugin declaration) that older Maven tolerated as warnings. Maven 4 is not an option either: 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.
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 (and the workflow lives here, not in the parent artifact). But the policy could be centralized: a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
CI runs a bare
mvn -B package, so it uses whatever Maven the GitHub runner image ships. That version drifts over time, and a recent runner Maven bump started failing builds on long-standing POM constructs (notably this repo's duplicatemaven-antrun-plugindeclaration, which older Maven tolerated as a warning).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).This pins the build to a fixed, reproducible Maven regardless of the runner default, and keeps it on the Java 11 line.
Verification
./mvnw -v→ Apache Maven 3.9.16 on Java 11../mvnw -B package→ BUILD SUCCESS locally on Java 11.Notes
maven-antrun-plugindeclaration (a warning on Maven 3.9, a hard error on newer Maven). Pinning to 3.9.16 keeps CI green now; the duplicate can be cleaned up separately.