All my classes were working fine. Then I wanted to create main/resources
to add logback.xml
in main/resources
in my project
I
If your project is eclipse project then it will automatically recognize the folders
Open command line, change directory to the folder with the pom.xml
and past this into the CMD:
echo This will create all required folders for maven project.
echo creating Application\Library sources
MD "src\main\java"
echo creating Application\Library resources
MD "src\main\resources"
echo creating Resource filter files
MD "src\main\filters"
echo creating Web application sources
MD "src\main\webapp"
echo creating Test sources
MD "src\test\java"
echo creating Test resources
MD "src\test\resources"
echo creating Test resource filter files
MD "src\test\filters"
echo creating Integration Tests (primarily for plugins)
MD "src\it"
echo creating Assembly descriptors
MD "src\assembly"
echo creating Site
MD "src\site"
Try to add new Source Folder. Right click on your src->New>Source Folder:main/resources
Locate your pom.xml
. Navigate to the build
tag in it. Inside this tag you will have to look for any declaration regarding your source directory. Might be sourceDirectory
direclty, or it might appear in any of plugin
as well. Upon finding so, try un-commenting the same and do a Right Click->Maven->Update Project. Should solve for most cases. If not you have some other issue.
Right Click your project -> Build Path -> New Source Folder
Type the folder path, src/main/resources and click Finish.
Screenshots below.
Step 1: Figure: 1
Step 2: Figure: 2