共享Maven本地存储库 [英] Sharing Maven local repository

查看:97
本文介绍了共享Maven本地存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Maven将所有jar存储在本地存储库~/.m2/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?

推荐答案

您当然可以共享本地存储库.您只需要一个所有人都拥有写权限的文件夹.例如:/local/.m2/repository.要共享此文件夹,所有人都可以使用新的本地存储库更改settings.xml,如下所示:

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>

另外,所有人都可以在${MAVEN_HONE}/conf中使用settings.xml,然后就不必设置私有的settings.xml.

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

这篇关于共享Maven本地存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆