Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hudson - Maven is failing (cannot create /dev/null/.m2) on Tomcat-6 - Gentoo

I'm having major issues with getting Hudson up and running on a gentoo server with Tomcat 6. I'm able to deploy Hudson just fine, and I can browse the web-application, configure it and set up builds etc.

However, when I try to run a build (in example "clean test" on a Maven2 project) I get this error

ERROR: Failed to create /dev/null/.m2

I've google'd and for some it seems to be helping to put -DHUDSON_HOME=/home/hudson and -DMAVEN_HOME=/home/hudson in /etc/init.d/tomcat-6's JAVA_OPTS. However, I've tried that and by doing the same in /etc/conf.d/tomcat-6 , but I'm still getting this error.

Has any of you had to deal with this before?

like image 308
John Avatar asked Jun 02 '10 17:06

John


2 Answers

You are likely running Hudson under a special user. Try setting the home directory of that user to /home/hudson in /etc/passwd using the vipw command.

like image 90
Jouni K. Seppänen Avatar answered Sep 28 '22 06:09

Jouni K. Seppänen


Another way would be to disable user level config with your $M2_HOME/conf/settings.xml but Jouni's solution is the better choice.

like image 44
puug Avatar answered Sep 28 '22 06:09

puug