我在JUnit測試中運行以下代碼來測試獲取git存儲庫。我正在爲JGit所需的每個基本功能編寫測試,以便我可以在我的應用程序中實現它們。問題是我在下面的git.fetch()調用中不斷收到以下錯誤:JGit/EGit加載翻譯包失敗en_US
Loading of translation bundle failed for [org.eclipse.jgit.JGitText, en_US]
org.eclipse.jgit.errors.TranslationBundleLoadingException: Loading of translation bundle failed for [org.eclipse.jgit.JGitText, en_US]
代碼示例如下。我驗證了存儲庫路徑和一切似乎是正確的。如果我在fetch調用中放置斷點,然後在MSysGit中運行相同的命令,它就可以工作。
try {
String remoteName = "origin";
URIish uri = new URIish(repository.getRepositoryDirectory());
saveRemote(repository2.getRepository(), uri, remoteName);
Git git = repository.getGit();
FetchResult r = git.fetch().setRemote(remoteName).call();
assertNotNull("Did not get any result from fetch.", r);
} catch (JGitInternalException ex) {
fail("Failed to do fetch. " + ex.getMessage());
} catch (InvalidRemoteException ex) {
fail("Failed to do fetch. " + ex.getMessage());
} catch (URISyntaxException ex) {
fail("Failed to do fetch. " + ex.getMessage());
}
謝謝!
越來越多,我正在使用此包後悔:( – 2013-01-07 19:17:09