I'm using the Continuous Integration Software "Hudson" to build Maven 2 projects. The Hudson server is deployed in a Tomcat running with the privileges of the "www-data" User on a Debian machine. When Hudson runs Maven to build a project then it complains that it can't write to the repository "/var/www/.m2". /var/www is the Home-Directory of the www-data User. I don't want this directory in /var/www. How can I configure Hudson or Maven to use an other directory for the Maven repository?
You can configure the path to the local repository by setting the <localRepository>
element (which defaults to ~/.m2/repository
) of the settings.xml
:
<settings>
...
<localRepository>/path/to/local/repo</localRepository>
...
</settings>
The default location for the settings file is ~/.m2/settings.xml
(but you can specify an alternate path for the user settings file using -s,--settings <arg>
when invoking maven).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With