Maven local repository location for Linux and Windows

Viewed 65528

I have a dual boot system with Windows and Linux. I have another partition which is visible to both Windows and Linux. I want to put my local repository there. How can I provide a path that both Linux and Windows will understand. Windows see it as d:/repository drive and Linux sees it as /media/234242342/repository. How should I configure this in pom.xml?

7 Answers

You can run :

mvn help:evaluate -Dexpression=settings.localRepository

source

If you are using CentOS version 7 the Maven local repository will be:

/root/.m2/repository/

Windows:

C:\Users<User_Name>.m2

Linux:

/home/<User_Name>/.m2

Mac:

/Users/<user_name>/.m2

And of course, for Linux and Mac, we can write in the short form:

~/.m2

Related