Authentication is required but no CredentialsProvider has been registered

参考
在使用JGit执行push命令时,遇到了如下错误:
Authentication is required but no CredentialsProvider has been registered
经查询后得知:git执行push命令时,需要配置git 用户名密码进行安全链接,
JGit中执行的操作如下: git.push().setCredentialsProvider(new UsernamePasswordCredentialsProvider(username, password));

posted @ 2021-03-16 14:54  来一杯coffee  阅读(3136)  评论(0)    收藏  举报