I'm trying to release a maven project using Jenkins release plugin and I have a lot of doubts about it.
To load the project into the workspace I'm using an ssh connection since the code is hosted on Bitbucket, I've added a private key to the Jenkins credentials plugin and I had no problem pulling the code.
The problem comes when it tries to create the tags in mercurial and change the pom version, is not being able to authenticate to the mercurial repository. From what I understand is not using the same credentials that when it does the pull. I get push failed with exit code: 255
Ia have the scm connections defined in the pom.xml
<scm>
<connection>scm:hg:ssh://hg@bitbucket.org/test/test_repo</connection>
<developerConnection>scm:hg:ssh://hg@bitbucket.org/test/test_repo</developerConnection>
<url>https://bitbucket.org/test/test_repo</url>
</scm>
How should I define the credentials in jenkins for it to use them to push the changes?
Is there some way to avoid altogether defining the connections in the pom.xml and use the same connection that is using to retrieve the code?