简体   繁体   English

Maven 代理配置与 Nexus

[英]Maven proxy configuration with Nexus

I am using Nexus and have configured maven-proxy and maven-hosted repositories, added them to a group repo and using that repo through settings.xml.我正在使用 Nexus 并配置了 maven-proxy 和 maven-hosted 存储库,将它们添加到组 repo 并通过 settings.xml 使用该 repo。 Now when a new dependency is added in pom, maven-proxy goes to maven central and downloads it.现在,当在 pom 中添加新的依赖项时,maven-proxy 会转到 maven 中心并下载它。 However, I do not want this.但是,我不想要这个。

My goal is to stop replying on Maven central completely, but I know it won't work until my hosted repository contains everything that maven needs.我的目标是完全停止回复 Maven 中央,但我知道在我的托管存储库包含 maven 需要的所有内容之前它不会起作用。

Issue is that Maven plugins like compiler, clean, jar etc. downloads tons of dependencies on its own.问题是 Maven 插件(如编译器、清理、jar 等)会自行下载大量依赖项。 If I remove connection to maven proxy, how do I get all that list and then how do I make sure that I put whatever is needed in my hosted repository?如果我删除与 maven 代理的连接,如何获取所有列表,然后如何确保将所需的任何内容放入托管存储库中?

Should I even try to put such artifacts in my hosted repo?我什至应该尝试将这些工件放在我的托管仓库中吗? Is there any other better approach?还有其他更好的方法吗?

You cannot really do that manually, the number of artifacts is way too large.你不能真正手动做到这一点,工件的数量太大了。

You can let Maven download all needed artifacts, then copy that from a remote to a hosted repository and work with that (until you need something new).您可以让 Maven 下载所有需要的工件,然后将其从远程复制到托管存储库并使用它(直到您需要新的东西)。

But it is still painful.但这仍然很痛苦。 I would not do that.我不会那样做。

If your concern is security, I would use an open source security scanner instead of blocking internet access altogether.如果您担心安全问题,我会使用开源安全扫描程序,而不是完全阻止互联网访问。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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