不分散版本号的Maven项目的层次结构 [英] Hierarchy of maven projects without scattering the version number

查看:59
本文介绍了不分散版本号的Maven项目的层次结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您将 Maven2 用作包含许多具有相同版本号工件的项目的构建系统,您将生成的版本的版本分散在所有pom.xml中.在许多产品中,甚至有两次-在人工制品本身的版本标签和父对象的版本标签中.因此,您必须在每个版本开关上更改并签入所有pom.xml的新版本.这有点烦人,尤其是如果您必须同时编写多个错误修复和开发版本的代码时.有办法解决吗?

If you use Maven2 as a build system for a project containing many artefacts with the same version number, you have the version of the resulting build scattered in all pom.xml. In many of them even twice - in the version tag of the artefact itself and in the version tag of the parent. Thus, you have to change and check in new versions of all pom.xml on every version switch. This is somewhat annoying, especially if you have to code for several bug fixing and a development version in parallel. Is there a way around that?

澄清:我的问题是,随着时间的推移,您在源代码控制系统中获得的每个pom.xml的许多版本,其区别仅在于pom的版本号和/或父pom的版本号.理想情况下,只要添加依赖项或其他内容,就只需要更改pom.

CLARIFICATION: My question is about the many versions of every single pom.xml that you get over time in your source control system that differ only by the version number of the pom and / or the version number of the parent pom. Ideally, you should only need to change the pom whenever you add a dependency or something.

例如,您有一个项目,其中包含工件foo-pom(所有人的父pom),foobar-jar,foobaz-jar和foo-war.在第一个发行版中,版本是1.0-出现在每个pom.xml中.在第二个版本中,版本是1.1-再次出现在每个pom.xml中.因此,您必须更改每个pom.xml-如果您应尽可能频繁地发布,这将很烦人.

For example you have a project with the artifacts foo-pom (the parent pom to all), foobar-jar, foobaz-jar and foo-war. In the first release the version is 1.0 - which appears in every pom.xml. In the second release the version is 1.1 - which again appears in every pom.xml. So you have to change every pom.xml - this is annoying if you release as often as you should.

更新:如果您认为这很重要:已经在考虑不必指定父版本.请转到 Maven JIRA问题并对其进行投票以使其受到更多关注.可能会在即将发布的版本中作为增强功能添加.您需要为此创建/拥有JIRA登录名.

UPDATE: If you think this is important: not having to specify the parent version is already being considered. Please go to the maven JIRA issue and vote for it to get it more noticed and more likely to be added as an enhancement in an upcoming release. You need to create/have a JIRA login for that.

存在另一个Stackoverflow问题,它基本上是关于同一问题的.

There is another Stackoverflow Question that is basically about the same problem.

推荐答案

还有另一个StackOverflow线程,该线程也涵盖了您可能想看看的这个主题.

简而言之,已经在考虑使用继承时不必指定父版本.请转到JIRA并对其进行投票,以使其受到更多关注,并更有可能在即将发布的版本中作为增强功能添加.

In short, not having to specify the parent version when using inheritance is already being considered. Please go over to JIRA and give it a vote bump to get it more noticed and more likely to be added as an enhancement in an upcoming release.

这篇关于不分散版本号的Maven项目的层次结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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