In a project, I have some crypto features that bundle their key along with the class. The project is built with ant and the key is properly bundled in the destination jar.
When I want to run the unit tests in the IDE however, the key cannot be found. The code does:
final ClassPathResource cpr = new ClassPathResource("com/foo/bar/keyfile");
final InputStream instr = cpr.getInputStream();
This throws an IOException because there is no "keyfile" in <project>/out/com/foo/bar/ as I would have expected.
How can I tell IntelliJ to include the keyfile in its classpath ?