user994165
user994165

Reputation: 9502

Errors after importing Maven project into Eclipse

I imported a Maven project into Eclipse. I was able to deploy it from the command line. In Eclipse it is full of red Xs. I have cleaned the project, updated the configuration and I ran the following command:

mvn -Declipse.workspace=<pathtoworksapce> eclipse:add-maven-repo

and I still have the same problem. The project is dependent on another project.

Upvotes: 1

Views: 5377

Answers (2)

user994165
user994165

Reputation: 9502

What I ended up doing was removing all of the projects in Eclipse, but not deleting the source files. Then instead of directly importing the code as Maven->Check out as Maven Projects with SCM, I selected Existing Maven Project and imported the code from my local machine. This got rid of the errors, but when I would right click on code and select "Open Declaration", I would get Error: Could not open the editor: The file does not exist" So I removed all projects again and this time I deleted all the ".project" files and repeated the import Existing Maven Project. So now there are no red Xs (dependency problems) and the lookup functionality within the code works.

Upvotes: 1

Alex Calugarescu
Alex Calugarescu

Reputation: 848

Go to your master project and type the following :

mvn install
mvn eclipse:eclipse


After that, import your project. You can also install m2eclipse for better support. If you use gwt or any other framework which has a custom maven execution, you should also install plugins for those in Eclipse.

Upvotes: 0

Related Questions