Skip to content

Pass siteMvn as a String so the site stage runs on Maven 4 - #575

Merged
slachiewicz merged 1 commit into
apache:masterfrom
slachiewicz:jenkins-sitemvn-string
Aug 4, 2026
Merged

Pass siteMvn as a String so the site stage runs on Maven 4#575
slachiewicz merged 1 commit into
apache:masterfrom
slachiewicz:jenkins-sitemvn-string

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

siteMvn is passed to doCreateTask whole, while maven is iterated:

for (def mvn in mavens) { ... doCreateTask(os, jdk, mvn, ...) }      // maven: a List is correct
...
doCreateTask( os, jdk, siteMvn, tasks, first, 'site', taskContext )   // siteMvn passed whole

and doCreateTask does jenkinsEnv.mvnFromVersion(os, "${maven}"). A Groovy List stringifies to the literal "[4.0.x]", which matches no case in mvnFromVersion and falls through to default: return 'maven_3_latest'. It is not null either, so the mvnName == null skip never fires — the site stage just quietly runs Maven 3.

maven: [ "4.0.x" ] stays a List; only siteMvn needs 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_latest still 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.

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>
@slachiewicz
slachiewicz merged commit d089fcc into apache:master Aug 4, 2026
1 check passed
@slachiewicz
slachiewicz deleted the jenkins-sitemvn-string branch August 4, 2026 12:16
@github-actions github-actions Bot added this to the 4.0.0-beta-2 milestone Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant