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
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.
You need to import the project as a Maven project. File -> Import -> Maven -> Import existing Maven project.
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.
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 !!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With