简体   繁体   中英

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.

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.

Go to your master project and type the following :



After that, import your project. You can also install 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM