【问题标题】:maven-release-plugin and maven 3.0.3maven-release-plugin 和 maven 3.0.3
【发布时间】:2012-02-02 07:29:02
【问题描述】:

我正在使用 maven 发布插件通过 maven-3.0.3 执行以下操作

mvn 发布:准备

一切似乎都很好,除了当它在 SVN 中创建标签时,它会使用正确的标签从标签文件夹中复制以前的版本。任何想法为什么?

如果我切换回 maven-2.2.1,标记是正确的,并且标记的内容是预期的。

使用 Maven 2.2.1:

[INFO] Tagging release with the label crcib-6.8.5...
[INFO] Executing: cmd.exe /X /C "svn --non-interactive copy --file c:\DOCUME~1\markand\LOCALS~1\Temp\maven-scm-1593649573.commit . <url>/svn/repos/crcib/tags/crcib-6.8.5"

使用 Maven 3.0.3:

[INFO] Tagging release with the label crcib-6.8.5...
[INFO] Executing: cmd.exe /X /C "svn --non-interactive copy --file c:\DOCUME~1\markand\LOCALS~1\Temp\maven-scm-2047728233.commit --revision 6331 <url>/svn/repos/crcib/tags/crcib-6.8.2 <url>/svn/repos/crcib/tags/crcib-6.8.5"

任何想法为什么?此外,在使用 Maven 2 时,似乎在开始标记之前下载了几个工件。 Maven 3 并非如此。

【问题讨论】:

  • 您的第二个输出(对于 maven 3)似乎有小错误:您提到了 crcib-6.8.2crcib-6.8.5。是这样吗?还要比较插件版本是否在 Maven 输出中匹配,例如[INFO] --- maven-release-plugin:2.7.2:preapre.
  • 这正是错误所在。它似乎是将 6.8.2 标记复制到 6.8.5 而不是做 Maven 2.2.1 所做的
  • 如果插件版本匹配,你如何比较?你知道我应该为 maven 3.0.3 使用什么 maven 发布插件版本吗?可能是不兼容的问题!
  • 我没有在maven 3下使用这个插件的经验。插件版本在目标执行之前显示在maven输出中。尝试分析mvn -X release:prepare...
  • 您是否检查了 scm 部分 (developerConnection) 是否与实际工作副本匹配?

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


【解决方案1】:

没有你的 pom.xml,很难知道问题出在哪里。

最明显的错误配置可能是ins scm,正如Wemu所说; :

<scm>
    <!-- Base URL of repository (trunk/tags/branches independant)-->
    <url>scm:svn:http://svn.my.company.com/repository</url>

    <!-- Current working url (NOT TAG ONE) -->
    <connection>scm:svn:http://svn.my.company.com/repository/trunk/my-project</connection>
    <!-- Current working url -->
    <developerConnection>scm:svn:http://svn.my.company.com/repository/trunk/my-project</developerConnection>
</scm>

这是版本以及我如何使用这个插件:

 <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-release-plugin</artifactId>
      <version>2.2.2</version>
      <configuration>
            <tagBase>svn.my.company.com/repository/tags</tagBase>
      </configuration>
</plugin>

当您使用 maven 发布插件时,这将修改您的 scm 配置以指向标签。 如果它真的是 maven 3 的问题,我从来没有注意到它。

能否请您发布 pom.xml(和 settings.xml)以供进一步分析?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-06-10
    • 1970-01-01
    • 2014-03-10
    • 2018-06-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多