I have the following setup:
- Synology DS1812+ with DSM 4.2-3211
- Java 1.6.0_43
- Apache Tomcat/6.0.36 (Installed as a synology package)
- Jenkins 1.529 (Deployed on Tomcat)
- Jenkins Grails plugin 1.6.3
On which I'm trying to create a job to build my Grails 2.2.3 project. I created a grails wrapper and configured the job to run the "clean" target with the grails wrapper just to see if everything is working. The problem starts when I run the job:
...
[EnvInject] - Injecting environment variables from a build step.
[EnvInject] - Injecting as environment variables the properties content
HOME=/volume1/jenkins/jobs/sampleproject
[EnvInject] - Variables injected successfully.
[workspace] $ /volume1/jenkins/jobs/sampleproject/workspace/grailsw clean --non-interactive
Downloading http://dist.springframework.org.s3.amazonaws.com/release/GRAILS/grails-2.2.3.zip to /home/.grails/wrapper/grails-2.2.3-download.zip
Exception in thread "main" java.io.FileNotFoundException: /home/.grails/wrapper/grails-2.2.3-download.zip (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
at java.io.FileOutputStream.<init>(FileOutputStream.java:145)
at org.grails.wrapper.RemoteFileHelper.retrieve(RemoteFileHelper.java:49)
at org.grails.wrapper.GrailsWrapper.configureGrailsInstallation(GrailsWrapper.java:135)
at org.grails.wrapper.GrailsWrapper.main(GrailsWrapper.java:58)
Build step 'Build With Grails' marked build as failure
...
For some reason I can't seem to override the /home/ directory for which the FileNotFoundException occurs. And it looks like (although this is not my expertise) another process is forked with the HOME environment variable set back to '/home'. Could someone point me in the right direction for where I could solve this issue?
So it seems jenkins is running under the "nobody" user which has it's home directory set to "/home". I managed to fix the problem by creating the "/home" directory manually and making the user "nobody" owner.
Although I'm still not totally satisfied with the solution I can work with this for now