imported maven project does not appear as java project. Shows folders

后端 未结 15 970
有刺的猬
有刺的猬 2021-02-02 11:01

I checked out the existing project source code from SVN to a folder in my system. Then I opened eclipse. Import Project-> Existing Maven Project.

It imported without iss

相关标签:
15条回答
  • 2021-02-02 11:45

    Try to:

    1. Right click the project->Configure->Convert to Maven Project

    ---- Edit ----

    If this doesnt work, it is likely that someone checked in their environment files into your SVN. If they checked in:

    • .project
    • .classpath
    • .settings/

    They could be conflicting with your environment (different settings/plugins/versions of eclipse...). Try dropping your project, deleting the folder/files, then remove these files from SVN, and repeat your initial process. All of these files/folders will get generated during the import to eclipse.

    ---- Edit 2 ----

    Per your recent edit to the question, you have a multi-module project. If you only did this on the parent project, then there is no source folder. So you wouldn't see it. You should:

    1. File->Import...
    2. Choose Existing Maven Projects, Next
    3. Set the Root Directory to ecs/ecs-ejb, Finish
    4. Repeat for all other modules.

    In eclipse, each module of a multi-module maven project needs its own eclipse project.

    0 讨论(0)
  • 2021-02-02 11:45

    Possibility is Module doesn't have .classpath.

    Kindly right click on Module and Change Project fact as Java.

    else

    If you are using command Prompt. 1. mvn eclipse:clean 2. mvn eclipse:eclipse

    else

    Delete Project from Eclipse don't delete content from disk. remove .classpath and .project

    Re-import as maven existing Project

    0 讨论(0)
  • 2021-02-02 11:47

    I got it working using Proyect --> Properties --> Project Facets

    In my case was a web project so I checked Java and Dynamic Web Module

    0 讨论(0)
  • 2021-02-02 11:47

    Try right click on project, Maven->Update Project... (or similar, the link name changes depending on version)

    This works for me when adding new folders, but I have not encountered the problem when importing a project.

    0 讨论(0)
  • 2021-02-02 11:49

    Right Click->Maven->Update Project.

    Above works perfectly fine for Eclipse Juno and solves the problem.

    0 讨论(0)
  • 2021-02-02 11:50

    Adding projects to working sets should help

    try it -> right click the project -> Maven -> Assign Working Sets... -> Add projects to working sets

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