尝试使用jenkins jslint文件.. java.io.FileNotFoundException:/ var / lib / jenkins / jobs / test / workspace(是一个目录)

时间:2015-05-22 23:13:13

标签: jenkins jslint

在jenkins作业控制台输出中看到错误..

[JSLint] Ready
[JSLint] calling jslint with args[-DxmlOutput=/var/lib/jenkins/jobs/test/workspace/, /var/lib/jenkins/jobs/test/workspace/src/main/resources/levels/level1.json, /var/lib/jenkins/jobs/test/workspace/src/main/resources/levels/level2.json, /var/lib/jenkins/jobs/test/workspace/src/main/resources/levels/level3.json]
[JSLint] JSLint path is jar:file:/var/lib/jenkins/plugins/jslint/WEB-INF/lib/classes.jar!/com/boxuk/jenkins/jslint/JSLintBuilder/jslint.js
ERROR: Build step failed with exception
org.mozilla.javascript.WrappedException: Wrapped java.io.FileNotFoundException: /var/lib/jenkins/jobs/test/workspace (Is a directory) (jslint.js#5732)
    at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1773)
    at org.mozilla.javascript.MemberBox.newInstance(MemberBox.java:202)
    at org.mozilla.javascript.NativeJavaClass.constructSpecific(NativeJavaClass.java:281)
    at org.mozilla.javascript.NativeJavaClass.construct(NativeJavaClass.java:200)
    at org.mozilla.javascript.ScriptRuntime.newObject(ScriptRuntime.java:2327)
    at org.mozilla.javascript.gen.c3._c149(jslint.js:5732)
    at org.mozilla.javascript.gen.c3.call(jslint.js)
    at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66)
    at org.mozilla.javascript.gen.c3._c0(jslint.js:5591)
    at org.mozilla.javascript.gen.c3.call(jslint.js)
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
    at org.mozilla.javascript.gen.c3.call(jslint.js)
    at org.mozilla.javascript.gen.c3.exec(jslint.js)
    at org.mozilla.javascript.Context.evaluateReader(Context.java:1135)
    at com.boxuk.jenkins.jslint.LintRunner.call(LintRunner.java:126)
    at com.boxuk.jenkins.jslint.LintRunner.call(LintRunner.java:28)
    at hudson.remoting.LocalChannel.call(LocalChannel.java:45)
    at com.boxuk.jenkins.jslint.JSLintBuilder.perform(JSLintBuilder.java:116)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
    at hudson.model.Build$BuildExecution.build(Build.java:205)
    at hudson.model.Build$BuildExecution.doRun(Build.java:162)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
    at hudson.model.Run.execute(Run.java:1744)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:374)
Caused by: java.io.FileNotFoundException: /var/lib/jenkins/jobs/test/workspace (Is a directory)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:110)
    at java.io.FileWriter.<init>(FileWriter.java:63)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.mozilla.javascript.MemberBox.newInstance(MemberBox.java:194)
    ... 26 more
Build step 'JSLint' marked build as failure

jenkins工作配置..

jenkins job configuration

以下是jenkins服务器上文件系统的外观。

jenkins@work:~/jobs/test/workspace$ pwd
/var/lib/jenkins/jobs/test/workspace
jenkins@work:~$ ls src/main/resources/levels/
level1.json level2.json level3.json

1 个答案:

答案 0 :(得分:0)

无论如何,作为一种解决方法,请尝试提供json文件的完整路径。

你可以试试这个:
要扫描的文件:/full_path/src/main/resources/levels/*.json

更新回答(2015-05-29)
我尝试了以下配置,它适用于我

屏幕截图1 enter image description here

屏幕截图2 enter image description here

截屏3 enter image description here

控制台输出日志 enter image description here