2

当我使用maven发布插件时,我遇到了一些问题,最常见的是tag scm failed,错误是:svn:“svn://192.168.5.222/show/test-show/trunk/show” does not in the revision 0 .

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:98)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:64)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

原因:org.apache.maven.plugin.MojoFailureException:无法标记 SCM

然后我找到了我的日志:

[INFO] 执行中:/bin/sh -c cd /data/.hudson/jobs/hxbos/workspace && svn --username liulaixi --password ' * ' --no-auth-cache --non-interactive copy --文件 /tmp/maven-scm-49732292.commit --revision 0 svn://192.168.5.213/hxbos/hxecp-src/trunk/hxbos svn://192.168.5.213/hxbos/hxecp-src/tags/hxbos/ hxbos-all-test-1.5.0 [INFO] 工作目录:/data/.hudson/jobs/hxbos/workspace

为什么我的--revision 是0?谁能帮帮我?谢谢!

4

4 回答 4

0

问题是你没有正确的 svn 版本。检查安装最新版本并针对您的环境进行设置。如果正确,mvn 将能够在上传 pom.xml 后读取此信息,并以此标记发布。

于 2013-03-09T00:45:49.353 回答
0

我犯了一个错误,我只检查了主干(没有标签分支)。

对我来说:svn-repository 存储在/svn/. Apache 有DAV svn用于支持<connection>标签(不确定我们是否需要 DAV)的配置,如下所示:

<Location /svn>
  DAV svn
  SVNPath /svn
</Location>

pom.xml其内部:

<scm>
    <url>http://www.myproject.com/svn/Project</url>
    <connection>scm:svn:http://www.myproject.com/Project</connection>
    <developerConnection>scm:svn:svn+ssh://root@www.myproject.com/Project</developerConnection>
</scm>

然后我做

svn co file:///svn/Project
cd Project/trunk/
eval `ssh-agent -s`
ssh-add   ~/mykey-to-commit-new-tag.ossh
mvn package gpg:sign
svn commit
mvn clean release:prepare release:perform -Darguments="-DskipTests -Dmaven.javadoc.failOnError=false" -X

我真正要做的是检查整个项目。

于 2016-09-29T22:07:37.967 回答
0

尝试将“tagBase”配置添加到您的 pom.xml:

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.2.2</version>
                <configuration>
                    <tagBase>https://svn.site.net.br/svn/SiteV6/Vitrine</tagBase>
                </configuration>
            </plugin>
于 2015-11-11T17:08:16.783 回答
-1

您是否尝试忽略此错误并再次尝试 mvn release:prepare ?对我来说它有效。不过不要问我为什么。

于 2013-07-26T07:33:35.113 回答