Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing scm tag values through a parameter by jenkins

Can I pass the values ​​of the parameter of scm for Jenkins?

in my pom.xml, I have the values ​​set as default:

<scm>
     <connection> scm:svn:https://172.10.10.30/svn/repPortal/branches/2012/Branch_A/ </ connection>
     <developerConnection>scm:svn:https://172.10.10.30/svn/repPortal/branches/2012/Branch_A/</developerConnection>
</ scm>

The problem is when I running with another branch and want to run a release by jenkins (within the release process, it generate the tag of the project) it always will get the value that is defined in pom.

I would passing a new path in a especific parameter at Jenkins that automatically will be set in scm pom project.

I did some tests by setting a string parameter in a parameterized building but he did not recognize the given parameters and error in construction.

Another way was to pass through the "release goals and options":

-X -Dresume=false release:clean release:prepare release:perform \
    -DscmConnection="scm:svn:https://172.10.10.30/svn/repPortal/branches/2012/Branch_B"-DscmDeveloperConnection = "scm: svn: https :/ / 172.10.10.30/svn/repPortal/branches/2012/Branch_B "scm: validate

The error persisted ...

Caused by: org.apache.maven.shared.release.ReleaseFailureException:
    Missing required setting: scm connection or developerConnection must be specified.

Is there a way to do this so that I can tell by Jenkins?

like image 291
ricardo Avatar asked May 11 '12 21:05

ricardo


2 Answers

I noticed the properties defined for the SCM connections are not correct. The property for setting the SCM connection on the command line is -Dproject.scm.connection and developer connection is -Dproject.scm.developerConnection.

like image 87
user944849 Avatar answered Sep 18 '22 06:09

user944849


According to MRELEASE-707 the properties connection and developerConnection are read only and cannot be set directly. You have to define your own property for the url and use it as placeholder (see: How to override maven property in command line?).

like image 34
SEBiGEM Avatar answered Sep 22 '22 06:09

SEBiGEM