ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: Which task
Date Fri, 24 Jan 2003 15:36:08 GMT
I looked at JWhich, and it's mostly equivalent to my <which> task, in that
it allows to know the exact URL of a resource to be found on the classpath
(again, <available resource=""/> tells you if it's found, just not where
exactly). I was about to say that it wouldn't solve Jakob's problem, since
the class to be found is missing some dependencies, but if fact it would,
since JWhich attempts to find the class file *resource*, not load it.

I can see three little things that would make JWhich more useful:

1) Make it Ant friendly: requires just making JWhich a pure bean, with an
execute method, instead of using static method. No need to have any
dependencies on Ant. The command line main() would just delegate to the bean
for the actual processing. That way, JWhich could be used as an Ant task.

2) JWhich unconditionally adds .class to the resource name found. I think it
should have two modes, one to find classes, the other to find resources
(like /com/acme/

3) When looking for resources (as opposed to classes), could report *all*
URLs for the searched resource. For example, I'd like to know all JARs which
have a /META-INF/services/com.acme.SomeService file.

But of course, these are just suggestions and my own personal opinion ;-)
BTW, thanks Mike for JDepend. I've used it extensively at work to sort out
really bad inter-package/module dependencies between our 5000+ classes, and
it was a life saver! I hacked it a bit to do the inter-module dependencies
(a module being a group of packages), which I think is useful to analyze
over 400 packages (reduces the analyze to 2 dozen modules).

Cheers, --DD

PS: Mike, we're talking about this thread: 

-----Original Message-----
From: Ken Gentle [] 
Sent: Thursday, January 23, 2003 7:25 PM
To: Ant Users List
Subject: Re: Which task

I don't have an Ant task for you, but attached is Mike Clark's JWhich,
( which will search a given classpath for a class.

Should be relatively straightforward to make it an ant task, but I don't 
have time right now... (which always seems to happen with the things that 
*I* could make an ant task out of...)

Dominique will probably have this done by the time everyone gets the post, 
anyway... ;^)


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message