当我尝试在 Hudson 上从 GIT 构建项目时出现错误。该项目位于 GitHub 中,如果这可能会有所不同的话。
错误是:
FATAL: One of setGitDir or setWorkTree must be called.
我无法在网上或 StackOverflow 上找到有关如何处理此问题的任何有用信息。我什至不知道从哪里开始解决这个问题。
这是完整的控制台输出:
Started by user anonymous
Checkout:workspace / D:\Hudson\jobs\{Name of App}\workspace - hudson.remoting.LocalChannel@1c2a5b50
Using strategy: Default
Checkout:workspace / D:\Hudson\jobs\{Name of App}\workspace - hudson.remoting.LocalChannel@1c2a5b50
FATAL: One of setGitDir or setWorkTree must be called.
java.lang.IllegalArgumentException: One of setGitDir or setWorkTree must be called.
at org.eclipse.jgit.lib.BaseRepositoryBuilder.requireGitDirOrWorkTree(BaseRepositoryBuilder.java:538)
at org.eclipse.jgit.lib.BaseRepositoryBuilder.setup(BaseRepositoryBuilder.java:506)
at org.eclipse.jgit.storage.file.FileRepositoryBuilder.build(FileRepositoryBuilder.java:89)
at hudson.plugins.git.GitAPI.<init>(GitAPI.java:92)
at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:897)
at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:889)
at hudson.FilePath.act(FilePath.java:791)
at hudson.FilePath.act(FilePath.java:773)
at hudson.plugins.git.GitSCM.gerRevisionToBuild(GitSCM.java:889)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:668)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1515)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:521)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:428)
at hudson.model.Run.run(Run.java:1390)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:40)
at hudson.model.ResourceController.execute(ResourceController.java:82)
at hudson.model.Executor.run(Executor.java:137)
以下是显示我如何使用 GIT 配置项目的屏幕截图: