Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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 issues. However, Project Explorer shows it as just folders instead of packages. (Like when we create a package and then add classes to it, it shows a different icon for package root). I opened Navigator and Package Explorer as well. But they are showing them as folders as well.

I tried:

mvn eclipse:clean mvn eclipse:eclipse 

on the root of the project. But it did not help.

Can anyone help on this one?

My folder structure:

ecs->      ecs-ejb->         src/java/main/com/xxx         pom.xml      ecs->ear->         src/java/main/com/xxx         pom.xml      pom.xml 
like image 711
Kevin Rave Avatar asked May 28 '13 19:05

Kevin Rave


People also ask

Where is application Java File in your Maven project directory?

If you observe, you will find that Maven also created a sample Java Source file and Java Test file. Open C:\MVN\consumerBanking\src\main\java\com\companyname\bank folder, you will see App. java.


2 Answers

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.

like image 161
Lucas Avatar answered Sep 28 '22 07:09

Lucas


Right click the project->Configure->Convert to Faceted Form

This solution worked for me

like image 45
prateek mehta Avatar answered Sep 28 '22 07:09

prateek mehta