Thursday, July 26, 2012

Setting the Location of the Maven Local Repository at the Command Line

If you ever need to temporarily override the directory Maven uses for your local repository when running Maven from the command line, you can do so by setting the property maven.repo.local:

    $ mvn -Dmaven.repo.local=/tmp/repository install

Why would you want to do this? I found a useful situation while logged into a server at work where my login had a form of "read-only" access, and therefore no home directory, but where I had access to Maven and needed to test something out. I'm sure there would be other reasons out there as well or the property wouldn't be available?

No comments:

Post a Comment