为什么有些公司或项目在自己的域上托管关系,而不使用Maven Central Repository?与安全有关吗?这是好习惯吗?
答案 0 :(得分:3)
几个原因:
settings.xml
仅需要有一个镜像条目。实际上,如果您有一个或两个以上的开发人员,那么这就是要走的路。
答案 1 :(得分:1)
In addition to proxying several external repositories already mentioned, repository manager groups allow you to combine hosted repositories as well into a single source. Said group can then be organized to return components in an ordered manner (central first, then others, for example). This makes configuration simpler and allow you to access your internal and external stuff from one place.
Additionally, if you wish to restrict who can access what, you can setup security policies to this affect. Usually that's not just related to Central, but imagine if you had 3 teams and didn't want them to share each others artifacts. Then 3 repositories, restrict the security per team but can be same config.
Another benefit is caching. If you download something, I download something and JF downloads something, that's 3 hits to the internet. If NXRM downloads it, that's 1 hit then you have it in your intranet.
Note, pretty much everything I just said is not related to just Maven, they're general repository manager perks.