我的项目架构是这样的:
--Parent
--Submodule1
--Submodule2
--pom.xml(main)
Parent是包含所有maven插件配置,librairies版本等的项目。它是所有项目的父项,它是所有子模块的父项。 我在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?
答案 0 :(得分:0)
以下是一些要检查的事项:
我的SCM网址如下所示:
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网址中的http:或https :(无论您用于执行原始结帐)。我注意到这些URL中有“svn:”前缀。 tagBase
的{{3}}说“例如,http://svn.apache.org/repos/asf/maven/plugins/tags
。网址是SVN网址,不包括SCM提供商和协议。”