简体   繁体   中英

Sharing Maven local repository

Maven stores all jars under local repository ~/.m2/repository/ . It occupies a lot of space when there are many users.

So, Is it possible to share this local repository by multiple users, perhaps under a different directory structure?

Simple answer No. The local reposiory is as the name implies for the user and not for multiple users. Apart from that Maven itself is not designed for that. It will usually come to problems.

Of course you can share the local repository. You just need a folder that all of you have write permission. eg: /local/.m2/repository . And to share this folder, you all can change the settings.xml with new local repository as below:

 <localRepository>/local/.m2/repository</localRepository>

Also you all can use the settings.xml in ${MAVEN_HONE}/conf and then you don't need to set private settings.xml .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM