2017-07-24 109 views
0

我剛剛使用Windows安裝程序安裝了Jenkins 2.60.2,然後將其配置爲運行我的Gradle任務。當運行Gradle任務時,Jenkins 2.60.2返回「CreateProcess error = 267,目錄名稱無效」

我的build.gradle位於C:\工作區\ SSD \的build.gradle,所以我把路徑詹金斯的配置頁面,現場「根構建腳本:」 C:\Workspace\SSD\build.gradle

當我點擊「立即建立「詹金斯返回

Building in workspace C:\Program Files (x86)\Jenkins\workspace\Testing 
[Gradle] - Launching build. 
[build.gradle] $ cmd.exe /C "gradle.bat gradle clean test -PSSD && exit %%ERRORLEVEL%%" 
The directory name is invalid 
FATAL: command execution failed 
java.io.IOException: Cannot run program "cmd.exe" (in directory "C:\Workspace\SSD\build.gradle"): CreateProcess error=267, The directory name is invalid 
    at java.lang.ProcessBuilder.start(Unknown Source) 
    at hudson.Proc$LocalProc.<init>(Proc.java:245) 
    at hudson.Proc$LocalProc.<init>(Proc.java:214) 
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:850) 
    at hudson.Launcher$ProcStarter.start(Launcher.java:384) 
    at hudson.Launcher$ProcStarter.join(Launcher.java:395) 
    at hudson.plugins.gradle.Gradle.performTask(Gradle.java:330) 
    at hudson.plugins.gradle.Gradle.perform(Gradle.java:221) 
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) 
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:735) 
    at hudson.model.Build$BuildExecution.build(Build.java:206) 
    at hudson.model.Build$BuildExecution.doRun(Build.java:163) 
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:490) 
    at hudson.model.Run.execute(Run.java:1735) 
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 
    at hudson.model.ResourceController.execute(ResourceController.java:97) 
    at hudson.model.Executor.run(Executor.java:405) 
Caused by: java.io.IOException: CreateProcess error=267, The directory name is invalid 
    at java.lang.ProcessImpl.create(Native Method) 
    at java.lang.ProcessImpl.<init>(Unknown Source) 
    at java.lang.ProcessImpl.start(Unknown Source) 
    ... 17 more 
Build step 'Invoke Gradle script' changed build result to FAILURE 
Build step 'Invoke Gradle script' marked build as failure 
Finished: FAILURE 

我改變了場‘根構建腳本’來C:\\Workspace\\SSD\\build.gradle,仍然無法正常工作。

當我使用gradle(沒有Jenkins)構建我的代碼時,它工作正常。

任何線索也許?
謝謝。

回答

1

https://wiki.jenkins.io/display/JENKINS/Gradle+Plugin的文檔以及它給出的錯誤,它預計該配置選項中的構建腳本的文件夾,而不是腳本本身的完整路徑。將其更改爲C:\Workspace\SSD,我預計它會起作用。

+0

工作。謝謝。我也發現了一個錯誤,在任務領域,我們不需要把'gradle',直接就是'clean build'這樣的參數。 – keylogger

相關問題