mvn release:自动执行指定包含release版本的scm标签
我想将我的 Maven 版本设置为以批处理模式运行,但我不喜欢默认的 scm 标签 ${artifactId}-${releaseVersion}
。相反,我想简单地用 ${releaseVersion}
; 标记它。但是,我不清楚这样的属性是否存在(即没有 -SNAPSHOT 后缀)。
我希望配置类似于下面的代码。 maven-release-plugin 可以使用这种默认标记吗?
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.0</version>
<configuration>
<tag>${releaseVersion}</tag>
</configuration>
</plugin>
I would like to setup my maven release to run in batch mode, but I'm not a fan of the default scm tag ${artifactId}-${releaseVersion}
. Instead, I'd like to simply tag it with ${releaseVersion}
; however, I'm unclear if such a property exists (ie. without the -SNAPSHOT suffix).
I'd like the configuration to resemble the code below. Is such a default tagging possible with the maven-release-plugin?
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.0</version>
<configuration>
<tag>${releaseVersion}</tag>
</configuration>
</plugin>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当我使用 Hudson 进行发布时,我刚刚开始使用它。我注意到 Hudson(使用 Maven 发布插件)正在使用类似 -Dproject.rel.com.example:my-artifact-id=1.0.1 的属性启动命令。使用以下插件配置:
导致标签为 REL-1.0.1
我是发布插件的新手,但我假设类似的东西可以从命令行工作。
I just got this to work when using Hudson to do my release. I noted that Hudson (with the Maven Release Plugin) is initiating the command with a property like -Dproject.rel.com.example:my-artifact-id=1.0.1. Using the following plugin configuration:
Resulted in the tag being REL-1.0.1
I'm new to the release plugin but I would assume something similar would work from the command line.
您可以传入以下属性:
releaseVersion - 您希望将其发布为哪个版本(1.0)
developmentVersion——下一个版本(2.0-SNAPSHOT)
tag -- 标签名称
1.0-SNAPSHOT 暗示 1.0 发行版本,但不设置它。您可以在 POM 文件中将该属性设置为常规属性。
You can pass in the properties for:
releaseVersion -- What version you want it to be released as (1.0)
developmentVersion -- The next version (2.0-SNAPSHOT)
tag -- The name of the tag
a 1.0-SNAPSHOT implies a 1.0 release version, but doesn't set it. You can set that property in your POM file as a regular property.
试试这个:
try this: