我正在使用mvn release:prepare
增加我的项目的版本号。我的 pom.xml 中有以下内容:
<scm>
<connection>scm:git:code.stuff.com/scm/project/repo.git</connection>
<developerConnection>scm:git:ssh://<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ccaba5b88cafa3a8a9e2bfb8b9aaaae2afa3a1" rel="noreferrer noopener nofollow">[email protected]</a>:7999/project/repo.git</developerConnection>
<tag>HEAD</tag>
</scm>
当我运行release:prepare
时,一切似乎都正常,但标记的提交仍然有 <tag>HEAD</tab>
在 POM 中。这不是应该改成git标签吗?我还在输出开头附近看到一条消息: [INFO] Not generating release POMs
。
我做错了什么吗?
我使用的是 Maven 3.3.3。
最佳答案
我一直在使用 maven-plugin-release 的包含版本。当我按照文档中所述向 pom.xml 添加显式版本号时:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
</plugin>
</plugins>
...
</build>
这解决了问题。我的理论是,这与没有正确读取 git 的输出有关。
关于git - Maven 版本 :prepare doesn't change <tag>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34009315/