mtk
mtk

Reputation: 13709

Import maven project in eclipse - folder structure not as expected

I am new to maven projects. Steps followed :

  1. I tried importing a maven project in eclipse through File -> Import.
  2. Gave the location of root dir of the svn checkout project. It recognized the pom.xml file.
  3. Clicked Finish. Project imported and all files were placed in the Project Explorer of the eclipse.

Problem:

The directory structure was not as that of a java package, it was just a normal folder structure. I am not able to browse the code quickly i.e. get the declaration, different calls to a method and all the code browsing shortcuts. It gives a error says.. Project not in Build Path. On right clicking the project, there are no options present in the 'Build Path'.

Please let me know, what I am doing wrong here. How to import a maven project correctly into eclipse and set it up ?

Upvotes: 8

Views: 20898

Answers (4)

Vedprakash Panda
Vedprakash Panda

Reputation: 41

I have faced similar issue . I have resolved this issue :

Right click on project -> properties -> Project Facets -> convert it into Facet form

And you can get the folder structure as you want

Upvotes: 3

swapnil thange
swapnil thange

Reputation: 11

I resolved this issue with:

  1. go to Window > Preferences > build path
  2. under output and source folder choose the project
  3. delete/backup original project and create/import the same.

your issue will be resolved.

Upvotes: 1

arunky
arunky

Reputation: 126

I faced the same issue and could resolve by following steps

  1. First ensure that you are able to maven clean or install. Just to ensure the proj setup works.
  2. Right click on Project.
  3. Navigate to Maven > Update project configuration.

This should resolve the issue. Hope this helps.

Upvotes: 2

ant
ant

Reputation: 22948

Run :

mvn eclipse:clean

Then

mvn eclipse:eclipse

And it should be it's old self again, if not refresh the project in eclipse and that should do it

Upvotes: 11

Related Questions