I'm reading a few files in my application and referring to them as new File("src/main/resource/filename")
and it works. But when I package the jar with the Maven assembly plugin and run java - jar
I get an error, naturally:
Error occured:
src\main\resources\UPDATE.txt
(The system cannot find the path specified)
Because there is no src/main/resources
in the jar, how can I refer to src/main/resources
as some kind of classpath variable, so that the application works both in standalone java and in an assembled jar?