It's all about the answers!

Ask a question

How do I use Jenkins and RTC to do Maven releases?


Christian Höltje (5810) | asked Oct 30 '13, 2:02 p.m.
retagged Dec 16 '13, 5:22 p.m. by David Lafreniere (4.2k7)
Caveat:  I'm a git and Jenkins master, but only an apprentice at RTC and journeyman at Maven.

So I have a Jenkins server, a Jazz SCM server and a Nexus server (maven repository).  Jenkins has the Team Concert plugin installed.

I have jobs that successfully build snapshots.

However, when I try to do a release via "Perform Maven Release" in Jenkins, it dies a horrible death.

Firstly, I have to install scmtools. :-(  This is because the maven jazz scm provider doesn't support buildtools.

And even when I do, and have my settings.xml set up correctly with a <server> section with my RTC credentials I get an error 54.  I was able to reproduce the problem via command line to get extra information:

bash$ scm status --username jenkins-ci --password "$(cat ~/.p)" ; echo exitcode $?
Workspace: (1000) "CGH Test Workspace" (This workspace is unreachable.)
  Could not determine the URI required to connect to the repository. The UUID of
  the repository is _gMhn4XGQRd6WdpIzJ8zv-g. If you know the repository URI run
  'login' command providing the repository URI. If not, please contact your
  administrator.
exitcode 54
I was able to work around this by manually running "scm login" on all the build slaves as the build user, but that is not a good way to do things. :-(

I'm running RTC (and scmtools) version 4.0.1, if that matters.

Accepted answer


permanent link
Takehiko Amano (1.3k3441) | answered Oct 30 '13, 10:42 p.m.
JAZZ DEVELOPER
Try to cache credentials via scm login -c  (-c option). This will create repository.txt file under $HOME/.jazz-scm. This file is cached until "scm logout".  Copy the directory somewhere, and specify the location via environmental varable CM_CONFIG_DIRECTORY or via option --config.

Some details can be found in this forum discussion.

 https://jazz.net/forum/questions/115922/rtc-command-line-interface-password-encryption
Christian Höltje selected this answer as the correct answer

Comments
Christian Höltje commented Nov 01 '13, 5:19 p.m.

But the maven scm provider says explicitly that you shouldn't need to do an 'scm login'.


I can do the above, but it seems odd that I have manage these files. 


Christian Höltje commented Nov 04 '13, 9:50 a.m.

I'm pushing out the repository.txt with puppet. I feel dirty doing it, but it seems to work. 

One other answer



permanent link
Nick Edgar (6.5k611) | answered Nov 09 '13, 1:44 p.m.
JAZZ DEVELOPER
The problem is that the workspace is loaded by the Team Concert plugin in Jenkins, which doesn't cache repository login info in the same way as the SCM CLI.  
This is a known issue, covered by: SCM CLI does not know repository URL for loaded workspace if it wasn't loaded by CLI (242038)
Doing a manual scm login is one workaround, but I agree it's tedious.  Another approach would be to do it from the maven script before doing the release.

Your answer


Register or to post your answer.