将Maven插件放在nexus存储库中 [英] Put Maven plugins in nexus repository

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

问题描述

我想使用Nexus设置Maven存储库,该存储库未连接到Maven Central(由于公司政策).

I would like to set up a Maven repository with Nexus, which is NOT connected to Maven central (due to company policy).

现在,当我启动Maven时,它会尝试下载许多插件:由于我未连接到Maven Central,所有下载均失败.

Now Maven tries to download a lot of plugins when I start it: All downloads fail because I am not connected to Maven central.

是否可以将插件放入我的Nexus存储库中,或者使用一组合理的插件安装Maven?

Is it possible to either put the plugins into my Nexus repository or install Maven with a reasonable set of plugins?

推荐答案

如果要拥有手动管理和配置的存储库,则必须首先配置所需的依赖项和插件.

If you want to have a manually managed and provisioned repository you will have to provision the needed dependencies and plugins first.

您可以例如使用我的 Maven存储库预配器完成该操作.

You can e.g. do that with my Maven Repository Provisioner.

或者您可以通过运行连接到中央存储库的大量构建来配置Nexus存储库,然后在代理所需的内容后将其脱机.

Or you could provision a Nexus repository by running a bunch of builds connected to the Central repository and then take it offline after whatever is needed was proxied.

另一种更好的解决方案是使用基于策略的方法并使用 Nexus防火墙.

Another, much better solution would be to use a policy-based approach and use Nexus Firewall.

您可能还对手动配置方法的问题感兴趣.我在 http://blog.sonatype.com/2013/10/golden上写了此博客-repository/

You might also be interested in the problems of the manual provisioning approach. I blogged about this at http://blog.sonatype.com/2013/10/golden-repository/

在任何一种情况下,您都必须设置和配置Maven settings.xml,以免混淆您的插件和项目的依赖项.

In either case you are going to have to set up and configure your Maven settings.xml so that dependencies of your plugins and your projects are not mixed up.

别忘了,Maven依赖于存储库来存储插件,插件依赖项和项目依赖项.所有这些都必须可用.

And don't forget, Maven relies on a repository for plugins, plugin dependencies and your project dependencies. All of these have to be available.

这篇关于将Maven插件放在nexus存储库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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