ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben <ajoo.em...@gmail.com>
Subject Problem in extending org.apache.tools.ant.taskdefs.Java class
Date Mon, 07 Aug 2006 20:05:28 GMT
Hi guys.

I hope this is the right place for me to ask development quesiton about Ant.

Please let me know otherwise.


I recently created a class loader implementation that will load
classes following hierarchical structure. i.e. jar files in the same
folder or sub-folders will take precedence over those in parent
folders or sibling folders.


This can resolve the classpath version problem where certain dependent
library requires a different version of a class. (One reason that
people could use to turn to maven)

Now I'm trying to create my own "java" task and "junit" task to
utilize this class loader. I would prefer not to make any syntax
change to the xml tag. The only difference would be to allow the  task
class to interpret a classpath like "lib;somextralib.jar" differently.
jar files in the "lib" folder will be automatically loaded following
the hierarchical rule.

One problem I'm facing here is, I cannot seem to be able to extend
org.apache.tools.ant.taskdefs.Java class to do what I want to do.

The executeJava() has quite long logic that I want to re-use. But I
can't seem to find an extension point to make use of my class loader.

The only way I can find out so far is to copy-paste the entire Java
class code and create my own version. But I'd like to avoid it if
possible.

There's similar problem with the JUnitTask class. But seems there's a
spot that I can hack in my logic. (to override the getCommandline()
method)

Any suggestion is appreciated.

Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message