简体   繁体   English

发布管理 - Maven,Bamboo和JIRA

[英]Release Management - Maven, Bamboo and JIRA

I'd like to find the best way to manage releases using Maven 2, Bamboo 3.1 and JIRA 4.3. 我想找到使用Maven 2,Bamboo 3.1和JIRA 4.3管理版本的最佳方法。 I've tried many things but I keep hitting dead ends due to bugs or missing functionality. 我尝试了很多东西,但由于漏洞或缺少功能,我一直在努力。

My end goal is to have versions come from JIRA, have Bamboo take those versions and build artefacts from them using Maven then deploy those artefacts to a repository (Nexus in our case). 我的最终目标是让版本来自JIRA,让Bamboo采用这些版本并使用Maven从它们构建人工制品然后将这些文物部署到存储库(在我们的例子中是Nexus)。

Here are the approaches I have tried: 以下是我尝试过的方法:

1) Use a place holder in all poms for project versions: 1)在项目版本的所有poms中使用占位符:

Parent pom 父母pom

<project ...>
  <groupId>group</groupId>
  <artifactId>parent</artifactId>
  <version>${ci.version}</version>
  ...
  <modules>...</modules>
</project>

Child pom 孩子pom

<project ...>
  <parent>
    <groupId>group</groupId>
    <artifactId>parent</artifactId>
    <version>${ci.version}</version>
  </parent>
  <artifactId>child</artifactId>
  ...
</project>

This builds if you start the build from the project root pom and specify -Dci.version=<my-version> on the command line. 如果从项目根pom开始构建并在命令行上指定-Dci.version=<my-version> ,则构建此方法。 Combine this with the Bamboo Release Management Plugin and I can build and deploy versions of my modules and release as needed. 将它与Bamboo Release Management插件结合使用,我可以根据需要构建和部署我的模块版本并发布。

The problem with this approach is that Maven does not replace place holder variables in poms when deploying or installing which means the poms in the repository have the ${ci.version} marker when I'd really like them to have the concrete version. 这种方法的问题是Maven在部署或安装时不会在poms中替换占位符变量,这意味着当我真的希望它们具有具体版本时,存储库中的${ci.version}具有${ci.version}标记。 Because of the place holder it means nobody can use the modules I deploy. 由于占位符,这意味着没有人可以使用我部署的模块。 See MNG-2971 . MNG-2971

2) Use concrete SNAPSHOT versions in the pom and configure bamboo to execute the Maven Release Plugin using the Bamboo Release Management Plugin. 2)在pom中使用具体的SNAPSHOT版本并配置bamboo以使用Bamboo Release Management Plugin执行Maven Release Plugin。

Unfortunately the Maven Release Plugin needs the version to increment to, the bamboo plugin allow you to get the name of the current version to build but not the next one. 不幸的是,Maven Release Plugin需要增加版本,Bamboo插件允许您获取要构建的当前版本的名称,而不是下一个版本。 Without this information using the Maven Release Plugin would increment the version to something that is not managed by JIRA. 如果没有这些信息,使用Maven Release Plugin会将版本增加到不受JIRA管理的版本。 To make this option work I'd either need the next version available to me or be able to run a plan after the Bamboo Release Management Plugin has done it's thing (this second fix would also add extra mess to the commit logs as you'd get one commit for the auto increment and one for the proper increment). 为了使这个选项工作,我要么需要下一个版本,要么能够在Bamboo Release Management插件完成它之后运行一个计划(这个第二个修复程序也会在你提交日志中添加额外的混乱得到一个提交自动增量和一个正确的增量)。

2.b) Same as 2) but you have to specify the next version in Bamboo before any release build through the plan configuration interface, setting the value manually to the next JIRA version the plan should be working on. 2.b)与2)相同,但您必须在通过计划配置界面进行任何发布构建之前在Bamboo中指定下一个版本,手动将值设置为计划应该处理的下一个JIRA版本。 This fixes the problem with 2) but adds extra manual steps. 这解决了2)的问题,但增加了额外的手动步骤。

3) Do things manually, probably using the Maven Release Plugin. 3)手动执行操作,可能使用Maven Release Plugin。 Completely ignore all release functionality in Bamboo and manually manage released on the command line by calling the Maven Release Plugin goal to change the version as and when needed. 完全忽略Bamboo中的所有发布功能,并通过调用Maven Release Plugin目标在需要时更改版本,在命令行上手动管理。 JIRA versions will also need to be released manually when this happens. 当发生这种情况时,还需要手动释放JIRA版本。 We also need to configure a bamboo build to run and test the tag that the release plugin creates for the non-SNAPSHOT version. 我们还需要配置一个bamboo构建来运行和测试release插件为非SNAPSHOT版本创建的标记。

This option has so much process involved something is bound to go wrong. 这个选项涉及太多的过程,一定会出错。

I can't be the only person trying to get automated releases using these technologies, can anyone help. 我不能成为唯一一个尝试使用这些技术获得自动发布的人,任何人都可以提供帮助。

Thanks 谢谢

matt, 亚光,

You have to specify in your goal -Dci.version={bamboo.custom.brmp.name} I stumbled upon your question when I was looking for exact the same information, but then for JIRA 4.4 and Bamboo 3.3, where the release management plugin has been replaced / upgraded with the JIRA Bamboo plugin ... 你必须在你的目标中指定-Dci.version = {bamboo.custom.brmp.name}我在寻找完全相同的信息时偶然发现了你的问题,但随后又发现了JIRA 4.4和Bamboo 3.3,其中发布管理插件已经用JIRA Bamboo插件替换/升级...

Hope this helps, 希望这可以帮助,

Francis 弗朗西斯

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

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