Currently we specify the location of local repository in the settings.xml. Is it possible to override this setting via command line or env variable, such that I can use an alternative location sometimes?
Because maven uses the id "central" internally for the main repository http://repo1.maven.org/maven2, defining another repository with the same id will override the default definition. Another way to avoid use of the central repository is with the use of mirrors in settings. xml.
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.
The Maven local repository is located in the /home/. m2 directory, the folder is probably hidden.
You would need to specify the maven.repo.local
parameter to do this.
mvn package -Dmaven.repo.local=/alternate/repo/location
Here is a related SO question.
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