Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

Can't import project XYZ from an existing workspace folder

This only happens for the root pom.xml

Eclipse in use: Luna Service Release 2 (4.4.2) Maven Integration for Eclipse 1.5.2.20150413-2215

I have tested with number of different maven projects and in different workspaces.

Please note this worked before, I have been working on some tutorials and created number of Maven projects with same name and artifact Ids etc. I have deleted all the earlier projects, but could there still be some conflicts ?

any suggestions will help

like image 368
zalis Avatar asked May 02 '15 08:05

zalis


People also ask

How do I fix POM XML error in eclipse?

Additionally,right click on the pom. xml file in the 'project explorer' > click on 'validate'. This should remove the red-error mark on file, if there are no problems in the XML configuration.

How do I add POM XML to an existing project in Eclipse?

You need to import the project as a Maven project. File -> Import -> Maven -> Import existing Maven project.

How do I run a pom XML file in eclipse?

Finally, with a modern version of Eclipse, just do "Import > Maven > Existing project into workspace..." and select your pom. xml. M2e will automatically manage your dependencies and download them as required. It also supports Maven builds through a new "Run as Maven build..." interface.


1 Answers

Yes, You should start your Eclipse Workspace out of the pom.xml folder.

for example: D:\workspace\Project_Name.

In your Project_Name folder which contains pom.xml.

So you have to select D:\workspace while starting the eclipse.

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

Hope, it will help !!

like image 75
chirag28feb Avatar answered Oct 04 '22 06:10

chirag28feb