Pass siteMvn as a String so the site stage runs on Maven 4 - #501
Merged
Conversation
asfMavenTlpPlgnBuild iterates the `maven` list, so a List is right there,
but `siteMvn` is handed to doCreateTask whole and stringified with
"${maven}". A List becomes the literal "[4.0.x]", which matches no case in
jenkinsEnv.mvnFromVersion and falls through to its default, so the site
stage has been running on maven_3_latest with no error.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Aug 4, 2026
Member
Author
|
Confirmed in production — this repo's own master build #171: The first two lines are the Since the shared library started provisioning Maven through the wrapper, the same value now also reaches The library-side fixes are apache/maven-jenkins-env#8 and apache/maven-jenkins-lib#23. |
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.
siteMvnis passed todoCreateTaskwhole, whilemavenis iterated:and
doCreateTaskdoesjenkinsEnv.mvnFromVersion(os, "${maven}"). A Groovy List stringifies to the literal"[4.0.x]", which matches nocaseinmvnFromVersionand falls through todefault: return 'maven_3_latest'. It is not null either, so themvnName == nullskip never fires — the site stage just quietly runs Maven 3.maven: [ "4.0.x" ]stays a List; onlysiteMvnneeds to be a String. apache/maven-deploy-plugin already does it this way.Verified by reading the shared library, not by running a build — the pipeline cannot be executed locally. It also does not make Jenkins green on its own:
maven_4_lateststill resolves to 4.0.0-rc-5 on the build nodes. This makes the configuration do what it already says.Same fix as apache/maven-clean-plugin#331.