简体   繁体   English

Maven:POM文件或settings.xml中的分发管理配置

[英]Maven : distribution management configuration in POM file or settings.xml

I would like to know what's the best practice for setting up the distribution management with maven. 我想知道使用maven设置分发管理的最佳实践是什么。

We have the nexus repository configured in the maven settings.xml and in the parent pom file. 我们在maven settings.xml和父pom文件中配置了nexus存储库。 Where as this is not consistent across all projects and we want to make it consistent? 因为这在所有项目中都不是一致的,我们想使其一致吗?

What's the best way? 最好的方法是什么? pom file or settings.xml? pom文件或settings.xml? what's the pros and cons? 优点和缺点是什么?

We have arguments that it should be in each person's settings.xml , so that they can release it where they want it. 我们有一个论点,认为它应该在每个人的settings.xml中,以便他们可以在需要的地方释放它。

Location and transport protocol settings in the pom. pom中的位置和传输协议设置。
credentials in ${userhome}/.m2/settings.xml $ {userhome} /。m2 / settings.xml中的凭据

Releases should be distributed to a consistent place, otherwise what the point of having a centralised repository or even artifact naming conventions. 应该将发布分发到一个一致的位置,否则应具有集中式存储库甚至是工件命名约定的意义。

If you want it in a non standard place for that project, then don't release it, it is obviously not a release. 如果要在该项目的非标准位置使用它,则不要发布它,它显然不是发布。

I think it's appropriate to put things in settings.xml that you would want to repeat for each project you work on on that workstation. 我认为将要在该工作站上工作的每个项目重复的内容放入settings.xml中是适当的。

So if all the projects your developers are working on are released to the same repository (which I would assume is what would occur in a corporate setting), then this setting makes sense to centralize. 因此,如果开发人员正在处理的所有项目都发布到同一存储库(我认为这是公司设置中发生的事情),则此设置很有意义。

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

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