3
votes

I'm trying to update my codebase using ant. I have placed svnant.jar, svnClientAdapter.jar, svnjavahl.jar under ANT_HOME\lib directory. I'm using the bellow code snippet and it gives error.

Problem: failed to create task or type svnSetting
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

<path id= "svnant.classpath" >
     <fileset dir= "${antlib.dir}" >
         <include name= "*.jar" />
     </fileset>
</path>
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svnant.classpath" /> 

<target name="init-svn">
 <svnSetting svnkit="false" javahl="true" username="***" password="****" id="svn.settings" />    
</target>

<target name="update-source" depends="init-svn">
        <svn refid="svn.settings" >
          <update  dir="${basedir}" revision="HEAD" url="${svn.url}"/>
        </svn>
</target>

can someone help me please?

1
possible duplicate of Define svnSetting globally - paulsm4
defined it globally. still having same issue. - Sujith
Checkout the following alternative to the svnant task: stackoverflow.com/questions/16305315/… - Mark O'Connor

1 Answers

2
votes

I guess you didn't defined the property antlib.dir anywhere. So here you build an empty classpath for the taskdef.

Actually if you put your jars into ANT_HOME\lib, you don't need to build a classpath for your taskdef. Just do:

<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" />

And to be sure Ant see your jars correctly, just run ant -diagnostics