0
votes

I had a job in Hudson and I have migrated it to Jenkins but it's failing in Invoke Ant build step.

BUILD FAILED D:..\build.xml:16: Problem: failed to create task or type svn Cause: The name is undefined. Action: Check the spelling. Action: Check that any custom tasks/types have been declared. Action: Check that any / declarations have taken place.

My build file look like this:

<property environment="env"/>

<property name="root.dir" value="${basedir}" />
<property name="bin.dir" value="${root.dir}/bin" />

<property name="user.svn" value="xxxx" />
<property name="pass.svn" value="xxxx" />

<target name="checkout-bin">
    <echo message="CHECKOUT" />
    <delete dir="${bin.dir}" />
    <svn javahl="false" username="${user.svn}" password="${pass.svn}">
        <checkout url="${url.svn}" revision="HEAD" destPath="${bin.dir}" />
    </svn>
</target>

I'm giving the url.svn as property of Build step like this url.svn=xxxxxxxx

1

1 Answers

0
votes

The svn task is a custom task in Ant, i.e. it is not part of the built-in tasks like echo and property. You need to explicitly define and import that task.

See this short article for how to do it. Basically it goes something like:

<path id="svnant.classpath">
    <fileset dir="${svnant.lib.dir}">
        <include name="**/*.jar" />
    </fileset>
</path>

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

I don't know how it was working before on the old Hudson, but it definitely must have been defined somewhere in the Ant classpath.