Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

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.

0 votes


Accepted answer

Permanent link
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

0 votes

Comments

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. 

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


One other answer

Permanent link
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.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 6,121
× 562
× 343
× 151
× 113
× 45

Question asked: Oct 30 '13, 2:02 p.m.

Question was seen: 8,237 times

Last updated: Dec 16 '13, 5:22 p.m.

Confirmation Cancel Confirm