I’m trying to employ the Gradle release plugin on our client’s Jenkins (1.x, so no Jenkinsfile pipelines… ). I tested it on my box, and everything is well. However, when I invoke the build job, it fails with this output:
Task :foundation:checkUpdateNeeded FAILED
Running [git, remote, update] produced an error: [Permission denied (publickey).
I know that Jenkins has got a set of Git SSH Credentials, because the job starts by checking out a fresh copy from Git using these.
How can we make the release plugin use the credentials which are configured for the job during checkout?

Assuming it's a freestyle job and you're using private key to authenticate:
Use secret text(s) or file(s). Select git credentials and enter names for environment variables that you need to import.