Caffeine Induced
The Weblog of Lance Hankins
 
Saturday July 30, 2005
More Readable Classpaths for Ant Builds...

Its always a bit painful when you hit the inevitable ClassNotFound exception during development and you end up double checking an Ant classpath variable against the jars you think should be there. The way I typically debug this is to assign the particular ant classpath to a property, then echo the property value, e.g. :

Which will end up producing output that looks something like this (a big, semicolon delimited list of jars) :

That format gets a little painful to scan with the human eye, since all the paths typically begin with the same root. So here's a better way to do this : We'll use the <propertyregex> ant task to replace the semicolons in our debug variable with a newline and some whitespace.

Now when we run the aforementioned Ant snippet, it will produce the following output (much easier on the eyes) :

Posted by lhankins ( Jul 30 2005, 12:00:00 AM CDT ) Permalink
Comments:

Comments have been disabled.