How to create a src/main/resources directory?

后端 未结 10 1059
夕颜
夕颜 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:09

    Only maven project automatically generate resource folder inside src, other solution would be put logbackback.xml in src folder it ll work.

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

    maybe you could created the new folder.Then,opening this object's properties and clicking 'Java Build Path'.Reelecting the source folder on build path.Just try,man!

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

    To add a resource folder in eclipse:

  • Click on Build Path

  • Click on Configure Build Path

    (or Properties -> Java Build Path)

  • Click on Source Tab

    Click on Add Folder

  • Click on Create new Folder

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

    Right Click your project -> Build Path -> New Source Folder and Type the name of the the resource folder you want to create like ----->src/main/resources or src/test/resources ..it will create a new resource folder

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

    Since you're not using Maven, you shouldn't be creating the src/main/resources folder. Just put logback.xml in the src folder.

    Also move your java files (with their entire package folder structure) back to src as they were before creating the main/resources.

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

    The same problem I also encountered while I was learning the spring boot wanted to add logback.xml in resources. I am using sts for spring boot. As of my understanding, there are two things your file system folder structure and another sts folder structure. First I created a folder in your file system at src/main/ and then add this folder into build path. *


    For creating a folder follow below image 1,2 and 3

    *

    Now at the final step, add newly added resource folder into the build path. by clicking properties or directly build path button. Click on source tab and then click on add folder and browse the resources folder and add that's all. See below image for more description and help.

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