0
votes

I've created a custom ant task according to Apache doc.

Running ant, I get:

BUILD FAILED
/home/russ/blackpearl/fun/build.xml:92: taskdef class com.etretatlogiciels.ant.task.SqlScriptPreprocessor cannot be found using the classloader AntClassLoader[]

I have the following in build.xml prior to my use of

<taskdef name="sqlscriptpreprocessor" classname="com.etretatlogiciels.ant.task.SqlScriptPreprocessor" />

...and I've dropped a copy of sqlscriptpreprocessor.jar into my local lib subdirectory (should be on classpath) and even into /usr/bin/ant/lib (which is apache-ant-1.8.2).

Where should this go? Or what other problems are anticipated that I should look for?

Thanks very much for any and all comments.

Russ

1
What do you mean "local lib directory"?skaffman
The lib subdirectory that's on my build classpath and contains all the JARs I'm linking against (like Hibernate, log4j, Jersey, MySQL, Spring, etc.).Russ Bateman

1 Answers

6
votes

Try nesting

<classpath>
<pathelement location="C:\**\**.jar"/>
</classpath> 

Inside the taskdef, e.g.

<taskdef resource="net/sf/antcontrib/antcontrib.properties">
    <classpath>
        <pathelement location="C:\myfolder\ant-contrib-1.0b3.jar"/>
    </classpath> 
</taskdef> 

Ideally it should pick up from ant/lib, but specifying pathelement forces it to look in the given path.