3

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?

Sujith
  • 141
  • 2
  • 14
  • possible duplicate of [Define svnSetting globally](http://stackoverflow.com/questions/7913561/define-svnsetting-globally) – paulsm4 May 22 '13 at 05:11
  • defined it globally. still having same issue. – Sujith May 22 '13 at 07:33
  • Checkout the following alternative to the svnant task: http://stackoverflow.com/questions/16305315/the-svn-client-svnkit-is-not-available/16310312#16310312 – Mark O'Connor May 23 '13 at 00:32

1 Answers1

2

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

Nicolas Lalevée
  • 2,014
  • 1
  • 15
  • 14
  • I changed the ant file like this: I added your changes, but still having same issue. And then removed "init-svn" target including svnSetting. modified the code as bellow. Now it shows, Cannot find javahl, svnkit nor command line svn client – Sujith May 22 '13 at 10:04
  • Have you checked your jars are listed by `ant -diagnostics` ? – Nicolas Lalevée May 22 '13 at 18:38