简体   繁体   中英

Jenkins unable to invoke SENCHA CMD

I'm trying to configure Sencha CMD in Jenkins. I have added the classpath of Sencha in bash_profile.

If I try to invoke Sencha CMD on console, it works without any issues, but if I try invoke Sencha CMD through Jenkins I'm observing this error

Execute failed: java.io.IOException: Cannot run program "sencha": error=2, No such file or directory 
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041) 
at java.lang.Runtime.exec(Runtime.java:617) 
at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:41) 
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:428) 
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:442) 
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:628) 
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669) 
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:495) 
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) 
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:606) 
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) 
at org.apache.tools.ant.Task.perform(Task.java:348) 
at org.apache.tools.ant.Target.execute(Target.java:435) 
at org.apache.tools.ant.Target.performTasks(Target.java:456) 
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393) 
at org.apache.tools.ant.Project.executeTarget(Project.java:1364) 
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) 
at org.apache.tools.ant.Project.executeTargets(Project.java:1248) 
at org.apache.tools.ant.Main.runBuild(Main.java:851) 
at org.apache.tools.ant.Main.startAnt(Main.java:235) 
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) 
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) 
Caused by: java.io.IOException: error=2, No such file or directory 
at java.lang.UNIXProcess.forkAndExec(Native Method) 
at java.lang.UNIXProcess.<init>(UNIXProcess.java:135) 
at java.lang.ProcessImpl.start(ProcessImpl.java:130) 
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022) 
... 23 more 

Kindly help me in this.

-gowtham

Inorder to solve this issue, 1) install Envfile Plugin ( https://wiki.jenkins-ci.org/display/JENKINS/Envfile+Plugin ) 2) this plugin accept file(any extension) which can contain the all environment variables for example if you want export a path like sencha path for eyour project or increasing jvm memory size you can add those commands in a file and provide it path on jenkins

As per my problem concern sencha was configured for particular user bash profile. i just copied all of the bash profile content in new file and given the same file in jenkins plugin so each and every command whenever jenkins execute it will load all this envrionment file content.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM