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

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

问题描述

我的团队正在使用功能分支来实现新功能,并不断将快照构建部署到远程存储库中供我们的用户使用.因此,部署"实际上只意味着分发到远程 Maven 存储库".我们目前只为 master 分支而不是 feature 分支运行持续集成构建,原因如下:我们使用 Maven 构建我们的项目并将 JavaDoc 和源代码与 JAR 一起分发.

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:

  • 分支:master
  • 分类:无
  • 工件:foo-${version}.jar、foo-${version}-sources.jar、foo-${version}-javadoc.jar

分支:特征-X

我并不真正关心工件的确切命名,我只需要功能分支的单独的 main、source 和 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,尽管这可能会解决问题.您如何处理功能分支以及与 Maven 的持续集成?

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?

推荐答案

我建议将分支限定符添加到版本组件中,因为它与该部分更相关.这也允许您的快照依赖于主分支旁边的那些版本.

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天全站免登陆