classpath properties files not getting picked up

Hello,
IntelliJ IDEA 11
Windows 7
JDK 1.6
I have some xml and other files in a folder that are read as "getResourceAsStream()" by unit test classes - i added this folder in the module's dependencies as a "jar directory", but the junit tests still can't pick them up.
any idea what the right way is, to add these files to the classpath?
Thanks,
Nilesh
intellij issue.png

5 comments
Comment actions Permalink

Settings | Compiler | Resource patterns

0
Comment actions Permalink

Pardon my ignorance, but the "compiler | resource patterns" has always been "?*.properties;?*.xml;?*.gif;?*.png;?*.jpeg;?*.jpg;?*.html;?*.dtd;?*.tld;?*.ftl"
i have never changed it and it always worked for me in previous versions. the files that i'm hoping get picked up are .xml, so i don't see what else i need to do.
thanks,
Nilesh

0
Comment actions Permalink

Why don't you add the resources folders as test sources in the Sources tab, under the module settings..

0
Comment actions Permalink

Thanks John,
Actually this particular folder has files that are required by the application as well (bad design, no doubt, but old app, about to be sunset, blah blah blah), so i already had it listed under sources.

Finally figured out that IDEA 11 has yet another change - when i add a dependency, it requires me to classify it as a "classes", "jar directory" etc. etc. (attached image) - i was supposed to be adding it as "classes", and i was adding it as "jar directory". it's only when i dug into the .iml file that i realized how the two were different. once i switched to adding it as "classes", it worked.

issue2.png
Thanks everyone for helping.
Best,
Nilesh

0

Please sign in to leave a comment.