This is caused by JGitAPIImpl#provider is null for no one calls JGitAPIImpl#setCredentialsProvider nor JGitAPIImpl#setCredentials.
Credentials can be registered in "Manage Jenkins">"Configure System">"Manage Credentials", but there seems no way to specify a credential to use.
I verified that specifying proper Credential (e.g. fetch a one by CredentialsProvider#lookupCredentials) resolves the problem.
The problem is:
- The status of Git Client supporting JGit+SSH: JGit in Git Client is in development, so it may not yet be supported.
- From when this problem occurs:
JENKINS-18957 seems say that this does not happen in a proper version.
- JGitAPIImpl#provider is cast to CredentialsProviderImpl in TrileadSessionFactory#getSession. This stands for I cannot avoid the problem by creating a subclass of CredentialsProvider and register it as a default for JGitAPIImpl#provider.