views:

172

answers:

2

Is there a way in eclipse to search the classpath for arbitrary resource file names (or patterns)?

I know I can use either

Navigate > Open Type

(which will scan the classpath for classes) or

Navigate > Open Resource,

which will search for any resource type, but only in my project folders. Is there any way to achieve a combination ob both, to do a resource search (something like *.xsd) that searches all jars on the classpath?

A: 

Which Version are you using?

Because when I open the search-menu (Java-Search), I could choose, which space should be searched, whether the hole workspace or including all JRE-Libraries. Think, it should work for you.

I use a Galileo distribution, so I am current. java search only searches for types and members (e.g. field names, method names), not resources.
seanizer
I mainly meant your version, e.g. 3.5, but maybe it´s not that necessary. Try the "Remote Search" on your Work-Dir with options for "archive files" and "subfolders" on. It lasts a bit long (2-3 min, depends on your work-dir), but the result should fit your expectation. :)
Galileo is 3.5. I'll check this Soon,thanks
seanizer
ok, this is a directory scanner. the problem is: the jars are not in the project dir, they are in my local maven repo (and there are tons of jars in there)
seanizer
And there are too many jars, you are not interested in, but also to many interisting jars, that you don´t want to choose them by hand!?Except for plugins (that I don´t know) the only given thing, which could help you, may be the e.g. File Search, but using a built "Working set", where you could collect all the classes and jars, you want to be searched.Do you need this searching often?
yes, I have projects with many dependencies, and they often include an XSD or a properties file somewhere that I'd like to find. obviously I can search them myself (that's what I did in this particular case) but this happens about twice a week and I find it rather annoying to search through 10 - 20 jars manually. but I think there is no solution
seanizer
Yes, there is a solution, but we didn´t found it yet. I think, there are even small application, which serve exactly your needs, if there isn´t a fitting eclipse-plugin, which I can´t imagine..
+1  A: 

The classpath helper plugin is at least a starting point. Looks like it doesn't provide a search but it seems to list all entries on the classpath.

I don't know if your fit and willing to modify it but it should provide the basic code to add some filename-based search on top.

Andreas_D
well this is definitely an interesting plugin. I'll certainly have a look at that. Danke :-)
seanizer
Andreas_D
I'll mark this as the correct answer because I think there is no 100% correct answer out of the box
seanizer