2

I want to use the M2 Relase Plugin to release artifacts on a Jenkins server. The access to and checkout of the sources from Subversion is done with help of the Credentials Plugin. For tagging and committing the changes during the maven release:prepare phase I need (in my case) the same credentials.

Is there a way to convince the M2 Release Plugin to take credentials from the Credentials Plugin?

Note: I don’t want to insert the credentials manually in the SCM login/password fields and I don’t want to store the credentials in an extra settings.xml file on the server as often suggested.

SEBiGEM
  • 588
  • 3
  • 9

1 Answers1

-1

I have implemented the following solution, where I do not have to insert the credentials manually again, but where the credentials are stored in a temporary settings.xml file on the file system during the build.

With help of the Config File Provider Plugin I have created an empty settings.xml and used the stored credentials as server settings. The server id I have filled with the hostname from the scm url (see answer to Externalising SCM credentials with Maven). In the Build Environment section of the Jenkins job configuration I have enabled Provide Configuration Files, selected the self created settings.xml, assigned a Variable and used this variable in Release goals and options with -s $variable (like in Running the Maven Release Plugin with Jenkins).

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