Sharing Maven local repository

戏子无情 提交于 2019-12-10 21:37:03

问题


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?


回答1:


Of course you can share the local repository. You just need a folder that all of you have write permission. e.g.: /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.




回答2:


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.



来源:https://stackoverflow.com/questions/22006335/sharing-maven-local-repository

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!