如何使用Maven持续构建和部署功能分支? [英] How to continuously build and deploy feature branches with Maven?

本文介绍了如何使用Maven持续构建和部署功能分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的团队正在使用功能分支来实现新功能,并将快照版本部署到远程仓库中供用户使用。因此,'deploy'真的只意味着'分发到远程Maven仓库'。我们目前只为主分支而不是功能分支运行持续集成构建,原因如下:我们使用Maven构建我们的项目,并在JAR旁边分发JavaDoc和源代码。

My team is using feature branches to implement new features and continuously deploys snapshot builds into a remote repo for our users to use. Thus 'deploy' really only means 'distributing to a remote Maven repository'. We're currently only running continuous integration builds for the master branch and not the feature branches for the following reason: we're using Maven to build our projects and distribute the JavaDoc and sources alongside the JAR.

我的计划现在是为每个功能分支构建添加一个分类器,并期望在创建和部署这样的工件时使用:

My plan was now to add a classifier to each feature branches build and expected that one to be used when creating and deploying the artifacts like this:


  • 分支:主

  • 分类:无

  • 工件: foo- $ {version} .jar, foo - $ {version} -sources .jar, javadoc.jar

  • Branch: master
  • Classifier: none
  • Artifacts: foo-${version}.jar, foo-${version}-sources.jar, foo-${version}-javadoc.jar

分支:feature-X

Branch: feature-X

我真的不在乎工件的确切命名,我只需要单独的主,源和JavaDoc工件的功能分支。事实证明,JavaDoc插件和源代码插件都没有考虑分类器配置,从而有效地覆盖为我的主构建创建的工件。

I don't really care about the exact naming of the artifact, I just need separate main, source and JavaDoc artifacts for the feature branch. It turns out, neither the JavaDoc plugin nor the source plugin consider the classifier configured and thus effectively overwrite the artifacts created for my master build.

我真的不想更改artifactId虽然这可能会解决问题。

I don't really want to change the artifactId although this would probably solve the issue. How do you approach feature branches and continuous integration with Maven?

推荐答案

我建议在版本组件中添加branch-qualifier ,因为它与该部分更相关。这还允许您在主分支旁边的那些版本的快照依赖。

I would suggest to add the branch-qualifier into the version component, as it is more related to that part. This also allows your snapshot dependencies on those versions alongside the main branch.

这篇关于如何使用Maven持续构建和部署功能分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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