8

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?

Gray
  • 115,027
  • 24
  • 293
  • 354
ricardo
  • 621
  • 1
  • 11
  • 22

2 Answers2

1

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.

user944849
  • 14,524
  • 2
  • 61
  • 83
  • So, I tried the following instruction in my jenkins but it doesn´t modified the scm tag defined in my pom.xml: -X -Dresume=false release:clean release:prepare release:perform -Dproject.scm.connection=scm:svn:https://172.10.10.30/svn/repPortal/branches/2012/Branch_B -Dproject.scm.developerConnection=scm:svn:https://172.10.10.30/svn/repPortal/branches/2012/Branch_B Is there other way to rewrite the settings? – ricardo May 14 '12 at 16:39
  • Add `-DdryRun=true` without `release:perform` in the same command. Take a look at the intermediate POMs maven creates. Do any of them look correct? Also, consider running this dryRun command on the command line without Jenkins, do you get the same result? Last but not least, `maven-release-plugin` version 2.3 was released yesterday, and they made some fixes related to SCM usage, that may help too. – user944849 May 15 '12 at 02:57
1

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?).

Community
  • 1
  • 1
SEBiGEM
  • 588
  • 3
  • 9