【问题标题】:An error of using maven release plugin使用maven发布插件的错误
【发布时间】:2012-10-11 03:31:13
【问题描述】:

我的项目架构是这样的:

--Parent
  --Submodule1
  --Submodule2
--pom.xml(main)

Parent 是包含所有 maven 插件配置、库版本等的项目。它是所有项目的父级,也是所有子模块的父级。 我在 pom.xml(main) 中配置插件,如下所示:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-release-plugin</artifactId>
  <version>2.3.2</version>
  <configuration>
    <tagBase>svn://192.168.5.213/hxbos/hxecp-src/tags/hxbos</tagBase>
    <branchBase>svn://192.168.5.213/hxbos/hxecp-src/branches/hxbos</branchBase>
    <remotetagging>true</remotetagging>
    <checkModificationExcludes>
      <checkModificationExclude>**/*.log</checkModificationExclude>
      <checkModificationExclude>**/*.jar</checkModificationExclude>
      <checkModificationExclude>**/system*</checkModificationExclude>
    </checkModificationExcludes>
  </configuration>
</plugin>

这是我的 scm 信息:

<scm>
  <connection>scm:svn:svn://192.168.5.213/hxbos/hxecp-src/trunk/hxbos</connection>
  <developerConnection>scm:svn:svn://192.168.5.213/hxbos/hxecp-src/trunk/hxbos</developerConnection>
  <url>scm:svn:svn://192.168.5.213/hxbos/hxecp-src/trunk/hxbos</url>
</scm>

但是当我使用:mvn release:prepare 时,出现错误:

 The svn tag command failed.
 Command output:
 svn: “svn://192.168.5.213/hxbos/hxecp-src/trunk/hxbos” does not exist in 
 revision 0.

为什么是修订版 0?

【问题讨论】:

  • 因为仓库不存在。检查具有给定 IP 地址的机器上是否有 /hxbos/hxecp-src 下的存储库 ..
  • 我确定存储库退出,我们正在使用。
  • 谢谢,我已经看过FAQ了,帮不上忙!修订版是0,为什么?
  • 所有子项目中都有scm元素吗?

标签: svn tags maven-release-plugin


【解决方案1】:

这里有几件事要检查:

  • 我的 SCM URL 如下所示:

    scm:svn:https://subversion.company.com/svn/maven/trunk/corporate-parent

注意https 部分;你显示scm:svn:svn,不知道它是如何工作的。

  • 有一个地方让我感到困惑:我使用 https 协议检查了一个现有项目,但 POM 在其 SCM 连接块中有“http”。不匹配导致发布时出现问题。因此,使您用于结帐的协议与 POM 中的 SCM 连接相匹配。如果你这样做了

    svn checkout http://192.168.5.213/hxbos/hxecp-src/trunk/hxbos

那么您的 SCM 块应如下所示:

<scm>
    <connection>scm:svn:http://192.168.5.213/hxbos/hxecp-src/trunk/hxbos</connection>
</scm>
  • 如果您要进行多模块构建,请在所有 POM 中定义 SCM 块,不要让它们从父 POM 继承。

  • 最后但同样重要的是,请确保您使用的是最新版本的发布插件。


编辑:在 tagBase 和 branchBase URL 中也使用 http: 或 https:(无论您用于执行原始结帐)。我注意到您在这些 URL 中有“svn:”前缀。 docs for tagBase 表示“例如,http://svn.apache.org/repos/asf/maven/plugins/tags。该 URL 是 SVN URL,不包括 SCM 提供程序和协议。”

【讨论】:

  • 谢谢你,你说的我都试过了,但又失败了,我快疯了。
  • 你用什么版本的svn来检查代码?如果你用-X 运行 mvn,你能看到 Maven 使用的是哪个版本的 svn?也许那里不匹配。
  • maven 版本:3.0.4 svn 版本:1.5 插件版本:2.3.2
猜你喜欢
  • 2012-11-15
  • 1970-01-01
  • 1970-01-01
  • 2015-07-09
  • 2013-09-28
  • 1970-01-01
  • 2021-11-10
  • 2011-06-18
  • 2020-05-07
相关资源
最近更新 更多