git plugin in Jenkins on Windows does not use credentials with submodule git plugin in Jenkins on Windows does not use credentials with submodule jenkins jenkins

git plugin in Jenkins on Windows does not use credentials with submodule


Yes, This is an issue which i have faced to clone a project and its sub module.

I was using https instead of git@ to clone the repos, git scm plugin only apply the credential passed via jenkins to main module and not for sub module.To fix the issue i had to run a process which stores the credential and passes it to any git operation which need authentication. Like this http://www.scmtechblog.net/2014/12/git-authentication-for-automation-script.html

Now, you are trying to access via git@ and still getting permission denied, Can you please make sure that the account has correct access on submodule repository for which you added the ssh keys.


Submodule authentication using the same credentials and protocol as the parent repository are now support with the Jenkins git plugin. Support was added in the 10 Sep 2016 release of Jenkins git plugin 3.0.0.

The submodule configuration portion of the job definition page ("Additional Behaviours" > "Advanced Sub-modules Behaviours") "now includes a checkbox "Use credentials from default remote of parent repository". Check that box and the credentials from the parent repository will be used for the submodules.

Note that the repository cloning protocols must be the same (ssh or https) for the parent repository and the submodules, otherwise the parent credentials can't be used with the submodule repository.