title: ant: failed to create task or type
body: <p>(Yes, I've read and played around based on answers to similar questions in this forum and in many others such as JavaRanch--to no avail yet.)</p>
  
  <p>I've created a custom ant task according to Apache doc.</p>
  
  <p>Running ant, I get:</p>
  
  <pre><code>BUILD FAILED
  /home/russ/blackpearl/fun/build.xml:121: Problem: failed to create task or type sqlscriptpreprocessor
  Cause: The name is undefined.
  Action: Check the spelling.
  Action: Check that any custom tasks/types have been declared.
  Action: Check that any &lt;presetdef&gt;/&lt;macrodef&gt; declarations have taken place.
  at org.apache.tools.ant.UnknownElement.getNotFoundException(UnknownElement.java:487)
  at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:419)
  at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:163)
  at org.apache.tools.ant.Task.perform(Task.java:347)
  </code></pre>
  
  <p>This is pursuant to a target in my <em>build.xml</em> file:</p>
  
  <pre><code>&lt;target name="mysql-preprocess"
          description="Preprocess MySQL database scripts into one file"&gt;
      &lt;sqlscriptpreprocessor inputfilepath="${basedir}/extras/blackpearl.sql.in"
                            outputfilepath="${basedir}/extras/blackpearl.sql" /&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p>I have <em>ant-contrib-1.0b3.jar</em> on the path *$ANT_HOME/lib*. I have <em>sqlscriptpreprocessor.jar</em> on that path, plus the local classpath for my build.</p>
  
  <p>In an attempt to exorcise this problem, I've tried every combination of the following set of statements, which I've picked up all over the place via Google, meaning one of the &lt;taskdef ant-contrib&gt; with one of the &lt;taskdef sqlscriptpreprocessor&gt; constructs, two of the first with one of the latter, one of the first with two of the latter, all together, none of them, etc.</p>
  
  <pre><code>&lt;taskdef resource="net/sf/antcontrib/antlib.xml" /&gt;
  &lt;taskdef resource="net/sf/antcontrib/antcontrib.properties" /&gt;
  &lt;taskdef resource="net/sf/antcontrib/antcontrib.properties"&gt;
      &lt;classpath&gt;
          &lt;pathelement location="/home/russ/dev/downloads/ant-contrib/ant-contrib-1.0b3.jar" /&gt;
      &lt;/classpath&gt;
  &lt;/taskdef&gt;
  
  &lt;taskdef name="sqlscriptpreprocessor" classname="com.etretatlogiciels.ant.task.SqlScriptPreprocessor" /&gt;
  &lt;taskdef resource="${basedir}/lib/ant-tasks/SqlScriptPreprocessor.properties"
           classpath="${basedir}/lib/ant-tasks/sqlscriptpreprocessor.jar" /&gt;
  &lt;taskdef resource="${basedir}/lib/ant-tasks/SqlScriptPreprocessor.properties"&gt;
      &lt;classpath&gt;
          &lt;pathelement location="${basedir}/lib/ant-tasks/sqlscriptpreprocessor.jar" /&gt;
      &lt;/classpath&gt;
  &lt;/taskdef&gt;
  </code></pre>
  
  <p>It's frustrating that it's not as easy as they say to add custom tasks to ant.</p>
  
  <p>I would greatly appreciate any and all comments.</p>
  
  <p>Thanks,</p>
  
  <p>Russ</p>