Maven local repository location for Linux and Windows
You don't do that in the POM, but in your ~/.m2/settings.xml
, which would be different for both Linux and Windows, so no problem. See the localRepository
element:
<settings>
<localRepository>d:\repository</localRepository>
<!-- or -->
<localRepository>/media/234242342/repository</localRepository>
...
</settings>
Each OS needs an M2_HOME
as per the Maven documentation. Inside $M2_HOME/conf/
you can put a settings.xml
file and in that you can specify the location for the local repository using the <localRepository/>
element.
So for your specific system, in Windows use
<localRepository>d:\repository</localRepository>
and in Linux
<localRepository>/media/234242342/repository</localRepository>