Maven root pom.xml marked red when importing an existing project into eclipse

When importing an existing maven project into eclipse, my pom.xml root is marked in red. when i select pom.xml the message reads:

Unable to import XYZ project from existing workspace folder

This only happens for the root pom.xml

Used by Eclipse: Luna Service Release 2 (4.4.2) Maven Integration for Eclipse 1.5.2.20150413-2215

I tested several different maven projects and in different workspaces.

Note that this worked before, I worked on some tutorials and created several Maven projects with the same names and artifacts, etc. I deleted all previous projects, but could there be conflicts?

any suggestions will help

+8
java eclipse import maven parent-pom
source share
3 answers

Yes, you have to start your Eclipse workspace from the pom.xml folder.

for example: D:\workspace\Project_Name .

In the Project_Name folder containing pom.xml .

So, you should select D:\workspace during the launch of the eclipse.

And now, then import the project called Project_Name as the maven project, it will work.

Hope this helps!

+19
source share

I also ran into this problem. I saved the name of the eclipse workspace and the existing maven project name and got an error importing pom.xml. Later, I opened a new workspace with a different name that does not match the existing maven project, and now I can import the maven project.

0
source share

Decision:

1.Click on the Windows tab, then Preference (if you are using Eclipse).

2. First, find workspaces and remove them from the list (which you can add later)

3. Then find Maven and select User Setting and check your .m2 path along with the updated setting.xml parameter (also check the proxy server for now)

4. Then run your eclipse and import the existing maven project again.

I am 100% sure that after this you will no longer encounter this problem. Good luck :)

0
source share

All Articles