Maven release using jenkinsfile

My repository is in bitbucket and saved sah public key in it. Ssh private key is saved in jenkins credentials.

I am able to clone the repo to my loc. ,

Issue :
Whenever I tried to do maven release, i got error like

  • unable to commit or git provider

Not sure why it us getting failedfailed feom jenkins.

Please help me on this… thanks in advance.

The maven release plugin assumes it is running in an environment that has permission to write to the remote repository. That message likely means that it does not have permission to write to the repository.

A message somewhat like that is reported by the maven release plugin when it is unable to push changes to the remote repository.

You might try a small experiment from inside the job to push something harmless to the remote repository. For example, you could create a tag from inside the job, push the tag, and then remove the tag. If you can’t push a tag or remove a tag, the maven release plugin can’t do the job it needs to do.

Thanks Mark for your reply.

As this maven release is done using Jenkinsfile job, then only i get these type of error.

Developer can do maven release from their local system

I think there is issue with ssh-key and please find the attached screenshot for further details.

Please guide me on ththis.

Yes, I agree that the ssh private key needed to push to the repository is not available from the agent that is attempting to perform that push. Try what I suggested earlier to see if that helps you identify the location that needs the private key.

Hi Mak,
I tried to push a commit to remote repository using jenkinsfile, but ended eith the error

Please refer the attched screenshot.

I need help… Thanks in advance

Hi Gavin,

Thanks for your replied.

I tried to implement the sshagent inside my jenkinsfile
however ended with fail.
Please look into the screenshot and let me know what can be done.

Thanks in advance!

sounds like you don’t have the ssh agent plugin installed.

The problem is your agent doesn’t have the proper ssh key to talk to your repo. You can add the key to the home directory of the user that is running the agent. Or you can use sshagent and jenkins to manage it in memory so keys are not on disk.