简体   繁体   中英

SVN checkout under Linux using Ant

When I run the build.xml in linux ubuntu, which should checkout the project from svn is giving the following error:-

svn:

BUILD FAILED
java.net.MalformedURLException: Invalid svn url: svn://xxx-xx-xx-xx-xx.compute-1.amazonaws.com/srv/svn
    at org.tigris.subversion.svnclientadapter.SVNUrl.parseUrl(SVNUrl.java:117)
    at org.tigris.subversion.svnclientadapter.SVNUrl.<init>(SVNUrl.java:63)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at org.apache.tools.ant.IntrospectionHelper$11.set(IntrospectionHelper.java:1069)
    at org.apache.tools.ant.IntrospectionHelper.setAttribute(IntrospectionHelper.java:388)
    at org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:392)
    at org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:349)
    at org.apache.tools.ant.UnknownElement.handleChild(UnknownElement.java:568)
    at org.apache.tools.ant.UnknownElement.handleChildren(UnknownElement.java:346)
    at org.apache.tools.ant.UnknownElement.configure(UnknownElement.java:198)
    at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:160)

Actually the path of svn is what I connect from my local box. So I don't know what path I shoul give here. The svn is in the same linux box.

My directory path where the build.xml is:-/home/ubuntu/antCheckout And the path where svn is:-/srv/svn

I also tried this path:- ssh://srv/svn but exception was same.

This is my build.xml:-

<?xml version="1.0"?>
<project name="Test" default="Main" basedir=".">
 <!-- Sets variables which can be used. -->
  <property name="checkout" location="./svncheckout" />
 <!-- Define the classpath which includes the jars 
      that are required for svnant.jar -->
 <path id="/usr/local/ant/apache-ant-1.7.1/">
  <pathelement location="lib/svnant.jar" />
  <pathelement location="lib/svnClientAdapter.jar" />
  <pathelement location="lib/svnjavahl.jar" />
  <pathelement location="lib/svnkit.jar" />
 </path>

 <typedef resource="org/tigris/subversion/svnant/svnantlib.xml"     
      classpathref="/usr/local/ant/apache-ant-1.7.1/" />


 <!-- Deletes the existing build, docs and dist directory-->
 <target name="clean">
  <delete dir="${checkout}" />
 </target>

 <!-- Creates the  build, docs and dist directory-->
 <target name="makedir">
  <mkdir dir="${checkout}" />
 </target>


 <!-- Checkout the latest source code of svnant itself-->
 <target name="svn">
  <svn username="guest" password="">
   <checkout url="svn://srv/svn" revision="HEAD" destPath="${checkout}" />
  </svn>
 </target>

 <target name="Main" depends="clean, makedir, svn">
  <description>Main target</description>
 </target>
</project>

Thanks for help.

If you're on Linux, do you have the Subversion command line client?

Try this:

$ svn --version

If you have the Subversion command line client, try this command:

$ svn ls svn://svn/srv

And see what you get. I bet you'll get an error telling you that svn://srv/svn isn't found or isn't a valid URL.

This line:

<checkout url="svn://srv/svn" revision="HEAD" destPath="${checkout}" />

Is equivalent to the command line:

$ svn checkout -rHEAD svn://srv/svn .svncheckout

You will have to find the valid Subversion repository URL before this command will work. Then, change the url parameter in the <checkout> sub-task to match that URL. Subversion uses URLs to point to the repository address.

By the way, exactly what is this suppose to be doing? Why is this checking out the working directory to the .svncheckout directory? That's a hidden directory in Unix.


By the way: svn co svn://127.0.0.1 isn't going to work unless the program snvserve is running on the local system. The svnserve program

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM