This was originally an article claiming that one possible work-around for Ant classpath problems when running JUnit is to explicitly include the Ant libraries into the JUnit task’s <classpath>.
But… That was just plain dumb!
I’ve since realized this was all just a silly mistake on my part. The junit task had its includeAntRuntime option turned off, which was the cause of the problems.
My so-called work-around was effectively just doing what “includeAntRuntime” would do if turned on (which is its default anyway).
Apologies to anyone that was misled by this. It’s horrible to realise that not only have I made a silly mistake and wasted time implementing a work-around, but I’ve also then published a load of tripe about it!
I really ought to know better – I usually check all the options on Ant tasks, even when copying existing code (which is how I’ve now spotted this mistake). I’m also usually better at diagnosing problems. Somehow, “includeAntRuntime” just didn’t register with me at the time, and finding a quick work-around disuaded me from delving deeper, which isn’t like me at all. Blame it on too many hours working and not enough rest and recovery – it must be time to take a day or two off!
Hopefully, replacing the article with this note will at least stop anyone being misled if they stumble across this page in future.

Recent Comments