如何使用 mvn release:update-versions 从发布标签创建新的 SNAPSHOT 分支?
How to create a new SNAPSHOT branch from a release tag using mvn release:update-versions?
如果我从 git 标记创建一个新分支,那么 POM(正确地)只包含非快照版本。所以,当我尝试使用:
mvn release:update-versions -DautoVersionSubmodules=true
我收到一个错误:
Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5:update-versions (default-cli) on project:
You don't have a SNAPSHOT project in the reactor projects list.
我可以改为检查 在 标记之前的提交,其中包含正确的代码。但这并不理想,因为从 git 历史中不清楚它是基于那个特定的发行版本。
如何从发布版本开始对多 POM 项目进行自动版本控制?
maven-release-plugin
有一个特定于创建分支的目标:它是 branch
。引用这个目标做出的过程:
- Check that there are no uncommitted changes in the sources
- Change the version in the POMs if you want to change it in the branch (you will be prompted for the versions to use)
- Transform the SCM information in the POM to include the final destination of the tag
- Commit the modified POMs
- Tag the code in the SCM as a new branch with a version name (this will be prompted for)
- Bump the version in the POMs if you want to change it to a new value y-SNAPSHOT (these values will also be prompted for)
- Commit the modified POMs
此目标将提示您在分支中选择所需的版本,您将能够指定 SNAPSHOT 版本。如果添加 autoVersionSubmodules
属性.
,它也可以很好地处理多模块项目
典型的调用是:
mvn release:branch -DbranchName=my-branch -DupdateBranchVersions=true -DupdateWorkingCopyVersions=false -DautoVersionSubmodules=true
我的构建发生了同样的问题。在 Jenkins 上是 运行。
我的问题在詹金斯内部得到了解决。
在 Jenkins build- GO to Workspace-> wipeed out the current Workspace 。
-> 同样对于 PROD 构建,大多数时候您应该将 SCM user/pwd 用于 Maven 发布构建
->然后输入一个新的内部版本号(可选)
一切正常。
如果我从 git 标记创建一个新分支,那么 POM(正确地)只包含非快照版本。所以,当我尝试使用:
mvn release:update-versions -DautoVersionSubmodules=true
我收到一个错误:
Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5:update-versions (default-cli) on project: You don't have a SNAPSHOT project in the reactor projects list.
我可以改为检查 在 标记之前的提交,其中包含正确的代码。但这并不理想,因为从 git 历史中不清楚它是基于那个特定的发行版本。
如何从发布版本开始对多 POM 项目进行自动版本控制?
maven-release-plugin
有一个特定于创建分支的目标:它是 branch
。引用这个目标做出的过程:
- Check that there are no uncommitted changes in the sources
- Change the version in the POMs if you want to change it in the branch (you will be prompted for the versions to use)
- Transform the SCM information in the POM to include the final destination of the tag
- Commit the modified POMs
- Tag the code in the SCM as a new branch with a version name (this will be prompted for)
- Bump the version in the POMs if you want to change it to a new value y-SNAPSHOT (these values will also be prompted for)
- Commit the modified POMs
此目标将提示您在分支中选择所需的版本,您将能够指定 SNAPSHOT 版本。如果添加 autoVersionSubmodules
属性.
典型的调用是:
mvn release:branch -DbranchName=my-branch -DupdateBranchVersions=true -DupdateWorkingCopyVersions=false -DautoVersionSubmodules=true
我的构建发生了同样的问题。在 Jenkins 上是 运行。 我的问题在詹金斯内部得到了解决。 在 Jenkins build- GO to Workspace-> wipeed out the current Workspace 。 -> 同样对于 PROD 构建,大多数时候您应该将 SCM user/pwd 用于 Maven 发布构建 ->然后输入一个新的内部版本号(可选)
一切正常。