Maven发布:准备不会改变<tag>

时间:2015-11-30 22:36:20

标签: git maven maven-release-plugin

我正在使用mvn release:prepare来修改项目中的版本号。我的pom.xml中有以下内容:

<scm>
    <connection>scm:git:code.stuff.com/scm/project/repo.git</connection>
    <developerConnection>scm:git:ssh://git@code.stuff.com:7999/project/repo.git</developerConnection>
    <tag>HEAD</tag>
</scm>

当我运行release:prepare时,一切似乎都有效,但标记的提交在POM中仍然有<tag>HEAD</tab>。这不应该被改为git标签吗?我还在输出的开头附近看到一条消息:[INFO] Not generating release POMs

我做错了吗?

我正在使用Maven 3.3.3。

1 个答案:

答案 0 :(得分:2)

我一直在使用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的输出有关。

相关问题