maven scm:签入错误
我的 Maven 脚本生成了一个简洁的“错误 1
”,我对如何从巨大的输出中提取根本原因感到有点茫然。
您能帮我找出此错误的根本原因吗?
这是我使用的命令:
mvn scm:checkin -Dmessage="check in"
error 1.
List item [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-scm-plugin:1.5:checkin' with basic configurator --> [DEBUG] (f)
basedir = E:\workspace\mtest [DEBUG] (f)
connectionType = developerConnection [DEBUG] (s)
connectionUrl = scm:svn:https://192.168.10.44/svn/FTMobileAdNetwork/trunk/personal/xuhuiw/mvntest/mtest/
[DEBUG] (f) developerConnectionUrl = scm:svn:https://192.168.10.44/svn/FTMobileAdNetwork/trunk/personal/xuhuiw/mvntest/mtest/
[DEBUG] (s) includes = src/*,pom.xml
[DEBUG] (f) message = check in my mtest [DEBUG] (f) password = wangxuhui [DEBUG] (f) pushChanges = true
[DEBUG] (f) settings = org.apache.maven.execution.SettingsAdapter@2d0479
[DEBUG] (f) username = xuhuiw
[DEBUG] (s) workingDirectory = E:\workspace\mtest [DEBUG] -- end configuration --
[INFO] Executing: cmd.exe /X /C "svn --username xuhuiw --password ***** --no-auth-cache --non-interactive commit --file C:\Users\xuhuiw\AppData\Local\Temp\maven-scm-2074558159.commit --targets C:\Users\xuhuiw\AppData\Local\Temp\maven-scm-5719724778329125171-targets"
[INFO] Working directory: E:\workspace\mtest
[ERROR] Provider message:
[ERROR] The svn command failed.
[ERROR] Command output:
[ERROR] svn: 'E:\workspace\mtest' is not a working copy
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-scm-plugin:1.5:checkin (default-cli) on project mtest: Command failed.The svn command failed. ->
[Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-scm-plugin:1.5:checkin (default-cli) on project mtest: Command failed.
The svn command failed. at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217) 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:319) at
org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at
org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at
org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at
org.apache.maven.cli.MavenCli.main(MavenCli.java:141) 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.launchEnhanced(Launcher.java:290) at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) Caused by:
org.apache.maven.plugin.MojoExecutionException: Command failed.The svn command failed. at
org.apache.maven.scm.plugin.AbstractScmMojo.checkResult(AbstractScmMojo.java:439) at
org.apache.maven.scm.plugin.CheckinMojo.execute(CheckinMojo.java:83) at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
[ERROR]
[ERROR]
这是我的 pom.xml
:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ftad.common.mtest</groupId>
<artifactId>mtest</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>mtest</name> <url>http://maven.apache.org</url>
<organization>
<name>众合广告</name>
</organization>
<properties>
<project.build.sourceEncoding>UTF-</project.build.sourceEncoding> </properties>
<scm>
<connection>scm:svn:https://192.168.10.44/svn/FTMobileAdNetwork/trunk/personal/xuhuiw/mvntest/mtest/</connection>
<developerConnection>scm:svn:https://192.168.10.44/svn/FTMobileAdNetwork/trunk/personal/xuhuiw/mvntest/mtest/</developerConnection>
</scm>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.5</version>
<configuration>
<password>wangxuhui</password>
<username>xuhuiw</username>
<basedir>./</basedir>
<exportDirectory>target</exportDirectory>
<includes>src/*,pom.xml</includes>
<workingDirectory>./</workingDirectory>
</configuration>
<executions>
<execution>
<id>pref-scm</id>
<configuration>
<includes>src/*,pom.xml</includes>
<checkoutDirectory>./</checkoutDirectory>
</configuration>
<goals>
<goal>checkin</goal>
<goal>checkout</goal>
<goal>update</goal>
<goal>add</goal>
<goal>validate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
<distributionManagement>
<site>
<id>apache.website</id>
<url>scp://people.apache.org/www/maven.apache.org/scm/maven-scm-plugin</url>
</site>
<repository>
<id>releases</id>
<url>http://192.168.10.6:8081/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://192.168.10.6:8081/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
</project>
My maven script generates a laconic "error 1
", and I am a bit at a loss as to how to extract the root cause from the huge output.
Could you help me in isolating said root cause for this error?
Here is the command I used:
mvn scm:checkin -Dmessage="check in"
error 1.
List item [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-scm-plugin:1.5:checkin' with basic configurator --> [DEBUG] (f)
basedir = E:\workspace\mtest [DEBUG] (f)
connectionType = developerConnection [DEBUG] (s)
connectionUrl = scm:svn:https://192.168.10.44/svn/FTMobileAdNetwork/trunk/personal/xuhuiw/mvntest/mtest/
[DEBUG] (f) developerConnectionUrl = scm:svn:https://192.168.10.44/svn/FTMobileAdNetwork/trunk/personal/xuhuiw/mvntest/mtest/
[DEBUG] (s) includes = src/*,pom.xml
[DEBUG] (f) message = check in my mtest [DEBUG] (f) password = wangxuhui [DEBUG] (f) pushChanges = true
[DEBUG] (f) settings = org.apache.maven.execution.SettingsAdapter@2d0479
[DEBUG] (f) username = xuhuiw
[DEBUG] (s) workingDirectory = E:\workspace\mtest [DEBUG] -- end configuration --
[INFO] Executing: cmd.exe /X /C "svn --username xuhuiw --password ***** --no-auth-cache --non-interactive commit --file C:\Users\xuhuiw\AppData\Local\Temp\maven-scm-2074558159.commit --targets C:\Users\xuhuiw\AppData\Local\Temp\maven-scm-5719724778329125171-targets"
[INFO] Working directory: E:\workspace\mtest
[ERROR] Provider message:
[ERROR] The svn command failed.
[ERROR] Command output:
[ERROR] svn: 'E:\workspace\mtest' is not a working copy
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-scm-plugin:1.5:checkin (default-cli) on project mtest: Command failed.The svn command failed. ->
[Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-scm-plugin:1.5:checkin (default-cli) on project mtest: Command failed.
The svn command failed. at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217) 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:319) at
org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at
org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at
org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at
org.apache.maven.cli.MavenCli.main(MavenCli.java:141) 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.launchEnhanced(Launcher.java:290) at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) Caused by:
org.apache.maven.plugin.MojoExecutionException: Command failed.The svn command failed. at
org.apache.maven.scm.plugin.AbstractScmMojo.checkResult(AbstractScmMojo.java:439) at
org.apache.maven.scm.plugin.CheckinMojo.execute(CheckinMojo.java:83) at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
[ERROR]
[ERROR]
And here is my pom.xml
:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ftad.common.mtest</groupId>
<artifactId>mtest</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>mtest</name> <url>http://maven.apache.org</url>
<organization>
<name>众合广告</name>
</organization>
<properties>
<project.build.sourceEncoding>UTF-</project.build.sourceEncoding> </properties>
<scm>
<connection>scm:svn:https://192.168.10.44/svn/FTMobileAdNetwork/trunk/personal/xuhuiw/mvntest/mtest/</connection>
<developerConnection>scm:svn:https://192.168.10.44/svn/FTMobileAdNetwork/trunk/personal/xuhuiw/mvntest/mtest/</developerConnection>
</scm>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.5</version>
<configuration>
<password>wangxuhui</password>
<username>xuhuiw</username>
<basedir>./</basedir>
<exportDirectory>target</exportDirectory>
<includes>src/*,pom.xml</includes>
<workingDirectory>./</workingDirectory>
</configuration>
<executions>
<execution>
<id>pref-scm</id>
<configuration>
<includes>src/*,pom.xml</includes>
<checkoutDirectory>./</checkoutDirectory>
</configuration>
<goals>
<goal>checkin</goal>
<goal>checkout</goal>
<goal>update</goal>
<goal>add</goal>
<goal>validate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
<distributionManagement>
<site>
<id>apache.website</id>
<url>scp://people.apache.org/www/maven.apache.org/scm/maven-scm-plugin</url>
</site>
<repository>
<id>releases</id>
<url>http://192.168.10.6:8081/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://192.168.10.6:8081/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
</project>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
重要的部分是:
因此请确保您的 Maven 任务在 SVN 工作副本中自行执行。
The important part is:
So make sure your Maven task execute itself in an SVN working copy.
您执行 scm:checkin 的目录需要是 svn 工作目录,这意味着该目录中应该有一个“.svn”,其中包含正确的内容(.svn 是 svn 管理目录,其中包含下载的原始文件)。
检查你的.svn目录是否存在或者是否为空(我发现当我在checkout执行配置中使用“includes=*”时,maven会擦除.svn目录),这导致后续的scm:checkin失败。在您的情况下,由于您使用的是“includes=src/*,pom.xml”,您的 .svn 目录可能甚至不存在。
要解决此问题,您可以首先在 maven-scm-plugin 中定义签出的执行(不使用包含),然后为添加/检查定义单独的执行。这是一个 pom.xml 来执行 scm:checkout、curl 下载,然后 scm:checkin
http://mywallstreettechjob.blogspot.com /2015/06/maven-scm-plugin-pomxml-sample-for-svn.html
The directory you execute the scm:checkin from needs to be a svn working directory, which means you should have a ".svn" in that directory with the correct contents inside(the .svn is the svn admin directory which contains the pristine files downloaded).
Check if your .svn directory exists or if it's empty ( i found out that when I used "includes=*" in the checkout execution configuration, maven wipes out the .svn directory), which caused the subsequent scm:checkin to fail. And in your case, since you are using "includes=src/*,pom.xml", your .svn directory might not even exist.
To fix this, you can define execution for checkout in the maven-scm-plugin first (without using includes), then define a separate execution for add/check. And here's a pom.xml to do scm:checkout, curl download, then scm:checkin
http://mywallstreettechjob.blogspot.com/2015/06/maven-scm-plugin-pomxml-sample-for-svn.html