The classpath attribute is not available to the created task. In the task one can use MyTask.class.getClassLoader() to get the classloader that loaded the task. If this is of type AntClassloader, one can use AntClassloader.getClassPath() to get the path used in the loader.
However there are a number of issues with this: - the MyTask may be in a system classpath, or other classpath - in which case, the classloader seen will not be the classloader used by <taskdef> - there must be other means to achive the same goal. - for example keep a reference to the path use use this refernce for the <java> task. Peter On 7/30/07, stanS <[EMAIL PROTECTED]> wrote: > > Lets say I have a taskdef in the build.xml > <taskdef name="mytask" > classname="MyTask" > classpath="path-to/my.jar" /> > > How do I get the 'classpath' part in the custom task that derived from Ant > Task class? > Could you point me to the right API? > > I want to use that classpath back with a 'java' task. > > Thanks > Stan. > > -- > View this message in context: > http://www.nabble.com/Getting-classpath-attribute-of-custom-task-tf4171205.html#a11866788 > Sent from the Ant - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]