Trying to jslint files using jenkins .. java.io.FileNotFoundException: /var/lib/jenkins/jobs/test/workspace (是一个目录)
Trying to jslint files using jenkins .. java.io.FileNotFoundException: /var/lib/jenkins/jobs/test/workspace (Is a directory)
在 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.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 服务器上的样子..
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
无论如何,作为解决方法,请尝试提供您的 json 文件的完整路径。
你可以试试这个:
要扫描的文件:/full_path/src/main/resources/levels/*.json
更新答案 (2015-05-29)
我尝试了以下配置,它对我有用
截图1
截图2
截图3
控制台输出日志
在 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.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 服务器上的样子..
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
无论如何,作为解决方法,请尝试提供您的 json 文件的完整路径。
你可以试试这个:
要扫描的文件:/full_path/src/main/resources/levels/*.json
更新答案 (2015-05-29)
我尝试了以下配置,它对我有用
截图1
截图2
截图3
控制台输出日志