Skip to content

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

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#331
slachiewicz merged 1 commit into
apache:masterfrom
slachiewicz:jenkins-sitemvn-string

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

siteMvn is passed to doCreateTask whole, not iterated:

def siteMvn = params.containsKey('siteMvn') ? params.siteMvn : '3.9.x'
...
doCreateTask( os, jdk, siteMvn, tasks, first, 'site', taskContext )

and doCreateTask does jenkinsEnv.mvnFromVersion(os, "${maven}"). A Groovy List stringifies to "[4.0.x]", which matches no case in mvnFromVersion and falls through to default: return 'maven_3_latest' — so the site stage has been running on Maven 3 with no error. Passing a String fixes it.

maven: is correctly a List — that one is iterated (for (def mvn in mavens)). Only siteMvn has this problem. apache/maven-deploy-plugin already passes it as a String.

Verified by reading the shared library only; a Jenkins pipeline cannot be run locally. Note this does not by itself turn the Jenkins build green — maven_4_latest on the build nodes still resolves to 4.0.0-rc-5, so a pom with <prerequisites> of rc-6 is rejected either way. This change makes the configuration do what it already says.

asfMavenTlpPlgnBuild passes siteMvn straight to doCreateTask, which does
jenkinsEnv.mvnFromVersion(os, "${maven}"). A Groovy List interpolates to
the literal "[4.0.x]", which matches no case in mvnFromVersion and falls
through to "default: return 'maven_3_latest'" - so the site stage silently
ran on Maven 3. The maven: parameter is unaffected because the shared
library iterates that list before passing each element.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@slachiewicz
slachiewicz merged commit ccc9098 into apache:master Aug 4, 2026
1 check passed
@slachiewicz
slachiewicz deleted the jenkins-sitemvn-string branch August 4, 2026 12:40
@github-actions github-actions Bot added this to the 4.0.0-beta-3 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