Jenkins:允许本地结帐

Lit*_*key 12 automation jenkins

这是我第一次使用詹金斯。我创建了一个只有一个文件的新文件夹,并在其中创建了一个 git 存储库。然后我使用该存储库设置 Jenkins。

我现在得到的是这个错误:

错误:Git 远程“path\hello”的签出已中止,因为它引用了本地目录,这可能不安全。无论如何,您可以通过将系统属性“hudson.plugins.git.GitSCM.ALLOW_LOCAL_CHECKOUT”设置为 true 来允许本地签出。完成:失败

我尝试使用以下命令启动詹金斯:

C:\Users\userName\.jdks\zulu11.56.19-ca-jdk11.0.15-win_x64\bin\java.exe -jar jenkins.war  hudson.plugins.git.GitSCM.ALLOW_LOCAL_CHECKOUT=true
Run Code Online (Sandbox Code Playgroud)

但这没有用。如何将“允许本地结帐”设置为 true?

小智 7

使用选项 -D 定义属性: -Dhudson.plugins.git.GitSCM.ALLOW_LOCAL_CHECKOUT=true


小智 5

我遇到了同样的问题,解决方案是:

-Dhudson.plugins.git.GitSCM.ALLOW_LOCAL_CHECKOUT=true需要在命令行调用中位于 -jar jenkins.war之前。

解决方案由以下资源提供:

https://community.jenkins.io/t/checkout-of-git-remote-aborted-because-it-references-a-local-directory/4110