I have a maven project which I develop using intellij IDEA. I have specified a resource directory in intellij which contains some configuration files and data files. When I run the program in intellij, there is no issue, but I would like to access these files when I run the jar-file from command line also, and I do not know how to specify for maven that a directory is a resources directory without it being copied into the jar-file, which I do not want. Is there a flag to java
to point out the resources directory?
Edit: To be clear, I have my jar file and I want to access a resource directory located outside my jar file using the classLoader. However, it seems as I cannot use -classpath
to specify where the classLoader should look, as there is no difference in behaviour.
I can of course open a normal text file, but I would rather have it work from the classLocader machinery.