maven scm:checkin error
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.
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/</develop开发者_StackOverflow中文版erConnection>
</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>
The important part is:
svn: 'E:\workspace\mtest' is not a working copy
So make sure your Maven task execute itself in an SVN working copy.
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
精彩评论