通过maven连接SVN

时间:2013-06-26 06:07:29

标签: maven

我需要通过Maven连接SVN。下面是我的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/maven-v4_0_0.xsd">
       <modelVersion>4.0.0</modelVersion>
       <groupId>com.sample.webapp</groupId>
       <artifactId>HellojBossApp</artifactId>
       <packaging>war</packaging>
       <version>0.0.1-SNAPSHOT</version>
       <name>HellojBossApp Maven Webapp</name>
       <url>http://maven.apache.org</url>

       <scm>
         <connection>scm:svn:http://svn/PRONTO/trunk/dev</connection>
         <developerConnection>scm:svn:http://svn/PRONTO/trunk/dev</developerConnection>
         <url>http://svn/PRONTO/trunk/dev</url> 
       </scm>  
       <dependencies>
        <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
        </dependency>
        </dependencies>  
        <build>
       <finalName>HellojBossApp</finalName>
         <plugins>
              <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-scm-plugin</artifactId>
             <version>1.8.1</version>
             <configuration>
              <connectionType>connection</connectionType>
               <username>keerthana</username>
          <password>keerthana</password>
           <checkoutDirectory>${project.basedir}/co/src</checkoutDirectory>
          <workingDirectory>${project.basedir}/co/src</workingDirectory>
        </configuration>
            </plugin>
          </plugins>      
         </build>
      </project>

如果我使用mvn运行:安装构建成功。但我不确定它是否与SVN连接。如何检查它是否连接到SVN?请帮帮我。

我尝试将目标作为svn:checkout clean install但我收到以下错误

      [ERROR] The svn command failed.
      [ERROR] Command output:
      [ERROR] 'svn' is not recognized as an internal or external command,
       operable program or batch file.

      Skipping HellojBossApp Maven Webapp
      [INFO] This project has been banned from the build due to previous failures.
      [INFO] ------------------------------------------------------------------------
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 3.094s
      [INFO] Finished at: Wed Jun 26 11:14:05 IST 2013
      [INFO] Final Memory: 5M/15M
      [INFO] ------------------------------------------------------------------------

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-scm-plugin:1.8.1:checkout (default-cli) on project HellojBossApp: Command failed.The svn command failed. -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException:无法执行目标org.apache.maven.plugins:maven-scm-plugin:1.8.1:checkout(default-cli)项目HellojBossApp:命令失败.svn命令失败。

请任何人帮助我运行脚本并查看其连接到SVN的消息。

提前致谢。

1 个答案:

答案 0 :(得分:0)

SVN无法正常使用。

日志消息

'svn' is not recognized as an internal or external command,

表示系统上未安装SVN。您需要先安装SVN客户端。

之后,Maven将能够查看该项目。