javaeclipsemaven

Eclipse doesn't show src/main/resources in my maven project the way I see it elsewhere


I am working on a maven project someone else created. The package explorer in eclipse looks like

their_project_name
   src/main/java
   src/main/resources
   src/test/java
   src/test/resources
   JRE System Library
   Maven Dependencies
   ...
   src
      main
      test
   pom.xml
   their_project_name.launch

I'm also working on a Maven project I started from scratch. Its structure looks like:

my_project_name
   src/main/java
   src/test/java
   JRE System Library
   Maven Dependencies
   src
      main
         resources
            ...
   pom.xml

In other words, when I tried to create the src/main/resources directory, it didn't show up in the explorer where I wanted it to go. It instead went in this src folder, instead of showing up at the top level. Is there a step I missed? If I look at the workspace from my OS explorer, our directory structures are the same.


Solution

  • Solution

    You need to add the resources folder to your classpath. Please do the following

    1. Right click the folder
    2. Hover over Build Path
    3. Click Use as Source Folder

    eclipse

    Those top level directories are source folder "short cuts"