Answer the question
In order to leave comments, you need to log in
How to properly use to access resources?
I am developing a Java SE application. I use various settings resources located in the standard directory. Those. when accessing a resource, the path is src/main/resources/resources.xml
When assembled with maven, resources are stored in the root.
The question is how to correctly set the path to the resource?
Or just make the same structure when assembling?
Answer the question
In order to leave comments, you need to log in
getClassLoader().getResourceAsStream(path);
path - path relative to resources.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question