How to create a src/main/resources directory?

后端 未结 10 1060
夕颜
夕颜 2020-12-14 18:57

All my classes were working fine. Then I wanted to create main/resources to add logback.xml in main/resources in my project

I

相关标签:
10条回答
  • 2020-12-14 19:30

    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"
    
    0 讨论(0)
  • 2020-12-14 19:31

    Try to add new Source Folder. Right click on your src->New>Source Folder:main/resources

    0 讨论(0)
  • 2020-12-14 19:32

    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.

    0 讨论(0)
  • 2020-12-14 19:34

    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

    0 讨论(0)
提交回复
热议问题