【问题标题】:maven scm - Does maven creates tag automatically?maven scm - maven 会自动创建标签吗?
【发布时间】:2013-04-22 22:54:08
【问题描述】:

我有以下配置 -

<scm>
<connection>scm:svn:http://example.com/tags/MyProject/MyProject-0.1</connection>
<developerConnection>scm:svn:http://example.com/tags/MyProject/MyProject-0.1</developerConnection>
<url>scm:svn:http://example.com/tags/MyProject/MyProject-0.1</url>
</scm>

我的问题是每次我的项目在 scm 配置上的版本更改都会更改。说从 0.1 到 0.2 等等...... 我们是否需要确保这些标签是在 svn 中创建的,还是由 maven 创建的?如果 Maven 使用我的上述配置创建标记,我已经有 http://example.com/tags/MyProject 可用但它没有标记上述内容?

谁能给我一些想法吗?

【问题讨论】:

    标签: maven maven-2 maven-3 maven-release-plugin maven-scm


    【解决方案1】:

    如果配置正确并且您使用的是maven-release-plugin,这意味着

    mvn release:prepare 
    

    SVN 标签是由Maven 自动创建的。所以没有必要检查。除此之外,如果您有不同的 SVN 布局,则可能需要更改 Maven-release-plugin 中的 tag-Base:

       Repo
        +-- Project
                +--- trunk
                +--- tags
                +--- branches
    

    也就是说你需要配置maven-release-plugin:

    <project>
      ...
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.4.1</version>
            <configuration>
              <tagBase>https://svn.mycompany.com/repos/myapplication/releases</tagBase>
            </configuration>
          </plugin>
        </plugins>
        ...
      </build>
      ...
    </project>
    

    【讨论】:

      【解决方案2】:

      svn copy 和 svn move 命令有一个名为 --parents 的选项。它说没有 --parents 选项,它不会创建中间目录。

      What is intermediate directories in SVN?

      这是一个应该在 http://jira.codehaus.org/browse/SCM

      【讨论】:

        猜你喜欢
        • 2014-12-05
        • 2011-07-26
        • 1970-01-01
        • 2011-10-03
        • 1970-01-01
        • 2013-05-24
        • 2012-10-22
        • 2010-12-17
        • 1970-01-01
        相关资源
        最近更新 更多