GIT -- gitflow的maven插件(gitflow-maven-plugin)

2024-05-25 12:48
文章标签 maven 插件 git plugin gitflow

本文主要是介绍GIT -- gitflow的maven插件(gitflow-maven-plugin),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

参考:https://github.com/aleksandr-m/gitflow-maven-plugin
maven如何引入插件,详见上面的参考地址

用法:

命令说明
mvn gitflow:release-startStarts a release branch and updates version(s) to release version.
mvn gitflow:release-finishMerges a release branch and updates version(s) to next development version.
mvn gitflow:releaseReleases project w/o creating a release branch.
mvn gitflow:feature-startStarts a feature branch and optionally updates version(s).
mvn gitflow:feature-finishMerges a feature branch.
mvn gitflow:hotfix-startStarts a hotfix branch and updates version(s) to hotfix version.
mvn gitflow:hotfix-finishMerges a hotfix branch.
mvn gitflow:support-startStarts a support branch from the production tag.
mvn gitflow:helpDisplays help information.

分支模型详见博客:http://blog.csdn.net/gaopeng0071/article/details/78773499

以上的maven操作,都可以增加参数,来达到快捷方便的效果。如下
mvn -DpushRemote=true -DallowSnapshots=false gitflow:release-start
- DpushRemote:true的时候自动push到远端仓库
- DallowSnapshots:true的时候,允许创建的分支中存在*-SNAPSHOT的jar存在。
- DskipTestProject=true:跳过单元测试


如下目标参数引用官网的介绍

  • The gitflow:release-finish, gitflow:release and gitflow:hotfix-finish goals have skipTag parameter. This parameter controls whether the release/hotfix will be tagged in Git. The default value is false (i.e. the release/hotfix will be tagged).

  • The gitflow:feature-start goal has skipFeatureVersion parameter which controls whether the feature name will be appended to the project version or not. The default value is false (e.g. if the project version is 1.0.0-SNAPSHOT and feature name is feature_name then after the execution it will be 1.0.0-feature_name-SNAPSHOT).

  • The gitflow:feature-start goal has featureNamePattern parameter which allows to enforce naming of the feature branches with a regular expression. Doesn’t have effect if it isn’t set or left blank. By default it isn’t set.

  • All -finish goals have keepBranch parameter which controls whether created support branch will be kept in Git after the goal finishes. The default value is false (i.e. the supporting branch will be deleted). If the pushRemote parameter is set to true and keepBranch is false remote branch will be deleted as well.

  • All -finish goals and gitflow:release have skipTestProject parameter which controls whether Maven test goal will be called before merging branches. The default value is false (i.e. the project will be tested before merging branches).

  • All release goals have allowSnapshots parameter which controls whether SNAPSHOT dependencies are allowed. The default value is false (i.e. build fails if there SNAPSHOT dependency in project).

  • The gitflow:release-finish and gitflow:release goals have digitsOnlyDevVersion parameter which will remove qualifiers from the next development version if set to true. For example, if the release version is 1.0.0-Final then development version will be 1.0.1-SNAPSHOT. The default value is false (i.e. qualifiers will be preserved in next development version).

  • The gitflow:release-finish and gitflow:release goals have developmentVersion parameter which can be used to set the next development version in non-interactive mode.

  • The gitflow:release-finish and gitflow:release goals have versionDigitToIncrement parameter which controls which digit to increment in the next development version. Starts from zero. For example, if the release version is 1.2.3.4 and versionDigitToIncrement is set to 1 then the next development version will be 1.3.0.0-SNAPSHOT. If not set or set to not valid value defaults to increment last digit in the version.

  • The gitflow:release-start and gitflow:release-finish have commitDevelopmentVersionAtStart parameter which controls whether the next development version is set and committed at start or after finish. By default the value is false which means that the next development version is set on the development branch after the release branch has been merged onto the development branch when finishing the release. This has the benefit of being able to easily cancel the release process simply by deleting the release branch. If the value is true then versioning happens on gitflow:release-start. First the project version is set to the release version on the development branch and the release branch is created. Then the development branch is set to the next development version. This allows the development branch to continue immediately with a new version and helps avoid any future merge conflicts related to project versioning. Has effect only when there are separate development and production branches.

  • The gitflow:release-start goal have fromCommit parameter which allows to start the release from the specific commit (SHA).

Remote interaction

At the start of the each goal remote branch(es) will be fetched and compared with the local branch(es). If the local branch doesn’t exist it will be checked out from the remote. Both of these options can be turned off by setting fetchRemote parameter to false.

At the end of the -finish goals development or production and development branches will be pushed to remote. This can be turned off by setting pushRemote parameter to false.

At the end of the -start goals newly created branch (release / feature / hotfix) can be pushed to the remote. This can be achieved by setting pushRemote parameter to true.

The default remote name is origin. It can be customized with custom_origin configuration in pom.xml.

这篇关于GIT -- gitflow的maven插件(gitflow-maven-plugin)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1001552

相关文章

每天认识几个maven依赖(ActiveMQ+activemq-jaxb+activesoap+activespace+adarwin)

八、ActiveMQ 1、是什么? ActiveMQ 是一个开源的消息中间件(Message Broker),由 Apache 软件基金会开发和维护。它实现了 Java 消息服务(Java Message Service, JMS)规范,并支持多种消息传递协议,包括 AMQP、MQTT 和 OpenWire 等。 2、有什么用? 可靠性:ActiveMQ 提供了消息持久性和事务支持,确保消

30常用 Maven 命令

Maven 是一个强大的项目管理和构建工具,它广泛用于 Java 项目的依赖管理、构建流程和插件集成。Maven 的命令行工具提供了大量的命令来帮助开发人员管理项目的生命周期、依赖和插件。以下是 常用 Maven 命令的使用场景及其详细解释。 1. mvn clean 使用场景:清理项目的生成目录,通常用于删除项目中自动生成的文件(如 target/ 目录)。共性规律:清理操作

在cscode中通过maven创建java项目

在cscode中创建java项目 可以通过博客完成maven的导入 建立maven项目 使用快捷键 Ctrl + Shift + P 建立一个 Maven 项目 1 Ctrl + Shift + P 打开输入框2 输入 "> java create"3 选择 maven4 选择 No Archetype5 输入 域名6 输入项目名称7 建立一个文件目录存放项目,文件名一般为项目名8 确定

git使用的说明总结

Git使用说明 下载安装(下载地址) macOS: Git - Downloading macOS Windows: Git - Downloading Windows Linux/Unix: Git (git-scm.com) 创建新仓库 本地创建新仓库:创建新文件夹,进入文件夹目录,执行指令 git init ,用以创建新的git 克隆仓库 执行指令用以创建一个本地仓库的

maven 编译构建可以执行的jar包

💝💝💝欢迎莅临我的博客,很高兴能够在这里和您见面!希望您在这里可以感受到一份轻松愉快的氛围,不仅可以获得有趣的内容和知识,也可以畅所欲言、分享您的想法和见解。 推荐:「stormsha的主页」👈,「stormsha的知识库」👈持续学习,不断总结,共同进步,为了踏实,做好当下事儿~ 专栏导航 Python系列: Python面试题合集,剑指大厂Git系列: Git操作技巧GO

Maven创建项目中的groupId, artifactId, 和 version的意思

文章目录 groupIdartifactIdversionname groupId 定义:groupId 是 Maven 项目坐标的第一个部分,它通常表示项目的组织或公司的域名反转写法。例如,如果你为公司 example.com 开发软件,groupId 可能是 com.example。作用:groupId 被用来组织和分组相关的 Maven artifacts,这样可以避免

git ssh key相关

step1、进入.ssh文件夹   (windows下 下载git客户端)   cd ~/.ssh(windows mkdir ~/.ssh) step2、配置name和email git config --global user.name "你的名称"git config --global user.email "你的邮箱" step3、生成key ssh-keygen

查看提交历史 —— Git 学习笔记 11

查看提交历史 查看提交历史 不带任何选项的git log-p选项--stat 选项--pretty=oneline选项--pretty=format选项git log常用选项列表参考资料 在提交了若干更新,又或者克隆了某个项目之后,你也许想回顾下提交历史。 完成这个任务最简单而又有效的 工具是 git log 命令。 接下来的例子会用一个用于演示的 simplegit

记录每次更新到仓库 —— Git 学习笔记 10

记录每次更新到仓库 文章目录 文件的状态三个区域检查当前文件状态跟踪新文件取消跟踪(un-tracking)文件重新跟踪(re-tracking)文件暂存已修改文件忽略某些文件查看已暂存和未暂存的修改提交更新跳过暂存区删除文件移动文件参考资料 咱们接着很多天以前的 取得Git仓库 这篇文章继续说。 文件的状态 不管是通过哪种方法,现在我们已经有了一个仓库,并从这个仓

忽略某些文件 —— Git 学习笔记 05

忽略某些文件 忽略某些文件 通过.gitignore文件其他规则源如何选择规则源参考资料 对于某些文件,我们不希望把它们纳入 Git 的管理,也不希望它们总出现在未跟踪文件列表。通常它们都是些自动生成的文件,比如日志文件、编译过程中创建的临时文件等。 通过.gitignore文件 假设我们要忽略 lib.a 文件,那我们可以在 lib.a 所在目录下创建一个名为 .gi