首页 > 解决方案 > 使用 JGit 在 Java 中克隆 repo 时出现 AccessDeniedException

问题描述

我正在以编程方式尝试使用 JGit API 克隆存储库。我正在使用以下代码,但是当我执行它时,出现错误。

我已经尝试了所有可能的解决方案,但我仍然无法解决问题。任何人都可以提供输入吗?

File localPath = File.createTempFile("TestGitRepository", "");
Git result = Git.cloneRepository()
                .setURI("https://gitlab.wuintranet.net/fe/wu-content.git")
                .setDirectory(localPath)
                .call(); 

https://gitlab.wuintranet.net/fe/wu-content.git ”上的仓库应该被克隆,但它抛出了这个错误:

java.nio.file.AccessDeniedException: C:\Program Files\Git\mingw64\etc.probe-e65aa729-82b1-4ff9-8d9b-3a4a7ea3de4a

标签: javagitjgitjgitver

解决方案


看起来他们在上一个版本中发现了一个错误。“5.3.1.201904271842-r”对我有用。你可以回去。这是详细信息

https://github.com/diffplug/spotless/issues/410


推荐阅读