Honsen
Honsen

Reputation: 327

When a jenkins job run as "Perform Maven Release" , how can I get the value of parameter MVN_RELEASE_VERSION in shell step?

I want to get the value of "MVN_RELEASE_VERSION" when the job run as "Perform Maven Release", then I can set value of docker tag in "Docker build and publish" step, but there's only "POM_VERSION" in env, that's not I wanted.

Is there any way to get the value of it ?

PS:

Jenkins version is 2.7.1

Maven Release Plugin version is 0.14.0

Maven Integration plugin version is 2.13

Upvotes: 3

Views: 1245

Answers (1)

Honsen
Honsen

Reputation: 327

I solved this by set:

JAVA_OPTS="-Dhudson.model.ParametersAction.keepUndefinedParameters=true"

I found it at this page: https://groups.google.com/forum/#!topic/jenkinsci-users/O2ccSWhKhpY

Daniel Beck said it's a side effect of SECURITY-170: https://wiki.jenkins-ci.org/display/JENKINS/Plugins+affected+by+fix+for+SECURITY-170

and had given a way to solve it: https://jenkins.io/blog/2016/05/11/security-update/

Upvotes: 2

Related Questions