When you execute mvn archetype:generate to create a project from an archetype, it creates the necessary project structure for the project.
The folder src/main/resources is supposed to contain the resource files like xmls and property files and is normally created at the time of project creation.
Class path resource error
If you add the resources at other paths, then you’ll receive following error message :
java.io.FileNotFoundException: class path resource cannot be opened because it does not exist
Therefore, you should add the resources under src/main/resources path.
Manually create src/main/resources path
If the resources folder already isn’t present in your maven project , you can just create the “resources” folder manually under src/main folder.
Once the resource folder is created, update the maven project by right clicking on the project name and then selecting :
Maven -> Update Project
Once the src/main/resources folder is created, we can add the resources in this path.
© 2016, www.topjavatutorial.com. All rights reserved. On republishing this post, you must provide link to original post