Reputation: 4452
I am trying to build maven
project using Jenkins1.58
every thing looks fine but, when I build the project I am getting this error.
java.io.IOException: error=13, Permission denied
Console log
Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/SpringHelloWorld3/workspace
> /usr/local/git/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> /usr/local/git/bin/git config remote.origin.url [email protected]:DrunkenCooder/spring3helloworld.git # timeout=10
Fetching upstream changes from [email protected]:DrunkenCooder/spring3helloworld.git
> /usr/local/git/bin/git --version # timeout=10
> /usr/local/git/bin/git -c core.askpass=true fetch --tags --progress [email protected]:DrunkenCooder/spring3helloworld.git +refs/heads/*:refs/remotes/origin/*
> /usr/local/git/bin/git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> /usr/local/git/bin/git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision b148eb99dead9a288afb0c9e6f6e87ae7aa133fe (refs/remotes/origin/master)
> /usr/local/git/bin/git config core.sparsecheckout # timeout=10
> /usr/local/git/bin/git checkout -f b148eb99dead9a288afb0c9e6f6e87ae7aa133fe
> /usr/local/git/bin/git rev-list b148eb99dead9a288afb0c9e6f6e87ae7aa133fe # timeout=10
Parsing POMs
[workspace] $ /home/qaserver3/app/jdk1.6.0_45/bin/java -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-agent-1.5.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/maven-3.3.3/boot/plexus-classworlds-2.5.2.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/maven-3.3.3/conf/logging jenkins.maven3.agent.Maven31Main /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/maven-3.3.3 /var/cache/jenkins/war/WEB-INF/lib/remoting-2.47.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-interceptor-1.5.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.5.jar 50233
ERROR: Failed to parse POMs
java.io.IOException: Cannot run program "/home/qaserver3/app/jdk1.6.0_45/bin/java" (in directory "/var/lib/jenkins/jobs/SpringHelloWorld3/workspace"): error=13, Permission denied
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
at hudson.Proc$LocalProc.<init>(Proc.java:244)
at hudson.Proc$LocalProc.<init>(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:803)
at hudson.Launcher$ProcStarter.start(Launcher.java:381)
at hudson.maven.AbstractMavenProcessFactory.newProcess(AbstractMavenProcessFactory.java:266)
at hudson.maven.ProcessCache.get(ProcessCache.java:236)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:755)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533)
at hudson.model.Run.execute(Run.java:1759)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
Caused by: java.io.IOException: error=13, Permission denied
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:1021)
... 12 more
Finished: FAILURE
I am using `Java 1.6_45` and I installed java using `.bash_profile`
and when I run `java -version` I get
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
I also modified the .bash_profile
under super user.
I have change all the permission to 775 recursively of java folder.
but still I am getting the above issue. Can any one please guide me to address this problem.
Upvotes: 1
Views: 13224
Reputation: 13716
That is clearly states it is a permission issue.
When you develop the code on windows machine and do the builds on the jenkins (which is linux or ubuntu).
Run this command on Git Bash to change the permissions
git update-index --chmod=+x some_shell_script.sh
Here x grant the execute permissions
Then do the git push
Upvotes: 1