Does anyone know why maven on Centos 5.x can’t find user settings unless I use ‘-s’?
- Home is set to /home/build
- $HOME/.m2/settings.xml exists, owned by user, can be read by user
- I’m using a fresh download of mvn 3.0.4 (fails with 3.0.3 too)
I suspect something in my environment is getting in the way, but I’m not sure what.
Can’t find user Settings — not using “-s”
[build@...]$ echo $HOME; mvn clean -X|grep setting
/home/build
[DEBUG] Reading global settings from .../apache-maven-3.0.4/conf/settings.xml
[DEBUG] Reading user settings from ?/.m2/settings.xml
[DEBUG] Imported: org.apache.maven.settings < plexus.core
Finds user Settings — “-s” used
[build@...]$ echo $HOME; mvn clean -X -s $HOME/.m2/settings.xml|grep setting
/home/build
[DEBUG] Reading global settings from .../apache-maven-3.0.4/conf/settings.xml
[DEBUG] Reading user settings from /home/build/.m2/settings.xml
[DEBUG] Imported: org.apache.maven.settings < plexus.core
Thanks
Peter
“su” command lies at the core of this particular issue. “su” can execute commands as another user. When used without the “-“ it doesn’t process startup scripts for that use which can lead to hybrid environments in some cases.
When writing an init.d startup script be sure to use “su -” when invoking commands or your build system user will execute using root user’s environment variables (HOME included)
Problem on Some OS because BAMBOO_USER operates with root user’s environment
More proper init.d script