Search code examples
jenkinsautomation

Jenkins: allow local checkout


It's the first time I'm using Jenkins. I created a new folder with just one file and created a git repository in it. Then I set up Jenkins with that repository.

What I get now is this error:

ERROR: Checkout of Git remote 'path\hello' aborted because it references a local directory, which may be insecure. You can allow local checkouts anyway by setting the system property 'hudson.plugins.git.GitSCM.ALLOW_LOCAL_CHECKOUT' to true. Finished: FAILURE

I tried to start jenkins using this command:

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

But it didn't work. How can I set this "allow local checkout" to true?


Solution

  • Define properties using option -D: -Dhudson.plugins.git.GitSCM.ALLOW_LOCAL_CHECKOUT=true