【问题标题】:Jenkins: allow local checkout詹金斯:允许本地结帐
【发布时间】:2022-07-19 06:01:03
【问题描述】:

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

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

错误:Git 远程 'path\hello' 的签出已中止,因为它 引用可能不安全的本地目录。你可以允许 无论如何,通过设置系统属性进行本地结帐 'hudson.plugins.git.GitSCM.ALLOW_LOCAL_CHECKOUT' 为真。完成的: 失败

我尝试使用以下命令启动 jenkins:

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

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

【问题讨论】:

    标签: jenkins automation


    【解决方案1】:

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

    【讨论】:

    • 当我尝试:java -Dhudson.plugins.git.GitSCM.ALLOW_LOCAL_CHECKOUT=true -jar jenkins.war,我得到这个异常:java.lang.ClassNotFoundException
    • 好的,现在可以了。该属性需要在引号之间。 -D"hudson.plugins.git.GitSCM.ALLOW_LOCAL_CHECKOUT=true"
    • 它对我很有效:-Dhudson.plugins.git.GitSCM.ALLOW_LOCAL_CHECKOUT=true
    猜你喜欢
    • 2018-11-22
    • 1970-01-01
    • 1970-01-01
    • 2013-04-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-07
    • 1970-01-01
    相关资源
    最近更新 更多