4

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?

Sean Patrick Floyd
  • 292,901
  • 67
  • 465
  • 588

2 Answers2

1

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 Dolk
  • 113,398
  • 19
  • 180
  • 268
0

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.

user357206
  • 87
  • 2
  • 12
  • 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. – Sean Patrick Floyd Jun 08 '10 at 10:25
  • 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. :) – user357206 Jun 08 '10 at 11:03
  • 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) – Sean Patrick Floyd Jun 08 '10 at 11:41
  • 1
    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? – user357206 Jun 08 '10 at 12:11
  • 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 – Sean Patrick Floyd Jun 08 '10 at 12:52
  • 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.. – user357206 Jun 08 '10 at 13:04