If you move optional.jar out of ANT_HOME/lib, you are in for a world of hurt. All tasks then have to be specifically declared as you've found and you will find lots of weird classloader issues. The most simple solution is to leave optional.jar in ANT_HOME/lib and also put the JUnit jar file there as well. Now everything will work as desired.

Jake

At 01:31 PM 1/26/2003 -0800, you wrote:
Hey all,

I recently add the <junit> task to our ant build file.  After wrestling
with the classpath a bit i stumbled across the following.

http://ant.apache.org/faq.html#delegating-classloader

It instructed me to remove the optional.jar from ANT_HOME/lib and then to
declare all optional tasks using taskdef.  No problem my team deleted the
otional.jar from ANT_HOME/lib, we added it to our CVS and we could run our
testcases via ant.

However shortly after that someone ran a target that used <replaceregexp>.
 They were getting the task not found error.  No problem I thought, just
declare it using taskdef and we should be all set.  So I added

<taskdef name="replaceregexp"
classname="org.apache.tools.ant.taskdefs.optional.ReplaceRegExp">
 <classpath>
    <pathelement location="lib/antarchive/optional.jar"/>
     </classpath>
</taskdef>

to our build.xml.  This seemed to help ant find the task but when it would
run it ir would spit out.

"No supported regular expression matcher found"

I tried to add a bunch of differnet libraries when I declared the task
jakarta-oro.jar, ant.jar.  But it would still give me the same error.  In
the junit task I also give a <classpath> for the junit task.  However
<replaceregexp> doesn't seem to support a nested <classpath>.

Anyone have any thoughts on this?

Thanks,
-John



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to