用公司范围内的超级/父POM覆盖超级POM [英] Overriding super POM with a company-wide super/parent POM

查看:122
本文介绍了用公司范围内的超级/父POM覆盖超级POM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们希望有一个全公司范围的超级POM ,该继承自通常的超级POM,并且我们的所有公司项目都将隐式继承.这可能吗?

We would like to have a company-wide super POM that would inherit from the usual super POM and from which all our company projects would inherit implicitly. Is this possible?

到目前为止,我们必须从我们公司范围内的超级POM中显式继承.这不是很方便且容易出错.

As of now we have to inherit explicitly from our company-wide super POM. This is not very convenient and error-prone.

有人可以建议吗?

推荐答案

目前尚无最佳实践,据我所知.例如,我不知道没有用于指定超级POM的命令行选项.

There is no best practice for this, of which I'm aware. I know of no command line option to specify a super POM, for example.

我能想到的唯一方法似乎是比明确地指定父母更容易冒风险,而且不方便,我会推荐它.您可以检出Maven的源代码,并在Maven中替换 super POM.使用自己的模型,基本上是为您的公司制作自定义Maven版本.然后,您必须强迫所有开发人员使用自定义的Maven版本,与我认为要避免的那样一样不便且容易产生风险.

The only way I can think of seems even more risk prone and less convenient than specifying a parent explicitly, and I would not recommend it. You could check out the source code for Maven, and replace the super POM in the Maven model with your own, basically making a custom Maven build for your company. Then, you'd have to force all your developers to use the customized Maven version, which is just as inconvenient and risk prone as what you're trying to avoid in my opinion.

我的公司拥有一整套公司母公司POM,它们均来自我们自己的超级POM.我们使用这种结构已经有好几年了.

My company has a suite of corporate parent POMs, all extending from our own super POM. We've used this structure for years and years without issue.

这篇关于用公司范围内的超级/父POM覆盖超级POM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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