In windows, maven downloads everything in the C:\Documents And Settings\MyUser\.m2
folder (or C:\Users\MyUser\.m2
). There exists some way to change the folder that it uses? Specially I want to set it to download anywhere BUT in the Documents And Settings
/Users
folder.
Windows – C:\Users\{your-username}\. m2\repository.
For windows users Usually it's in: C:\Users\USER_NAME\. m2\repository . However the mvn help:effective-settings command will surely show the local path in response xml.
Look at your settings.xml
in ${maven.home}/conf
or, preferrably, ${user.home}/.m2/settings.xml
(see this for details about the settings.xml
). You can add (or uncomment) the following section:
<!-- localRepository | The path to the local repository maven will use to store artifacts. | | Default: ~/.m2/repository --> <localRepository>/path/to/local/repo</localRepository>
as suggested by the commented out section already there by default. There, you should be able to change the path to achieve what you want.
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