pom.xml no such file or directory

耗尽温柔 提交于 2019-12-07 11:21:02

问题


I've got a problem when I am building my project. I uses the springsource tools (STS) version 3.1.0 on Linux platform. After I imported my project to the STS, the springsource tools told me that "No such file or directory" at the pom.xml file. The file is actually exist in the correct path. I think the project is working fine because I've tried to import the same project with the same procedure in the other computer.

When I use console to compile the project with maven, all of them are complied successfully.

I've also tried the following but still not work: 1. reinstall the STS. 2. re-import the project. 3. create a user profile and re-import project. 4. use older version of STS (3.0.0)

I want to import the project to my computer so that I can work with. Please suggest to resolve the problem. Thanks!


回答1:


Had "No such file or directory" error on pom.xml in Eclipse Luna SR1.

Tracked it down to be caused by faulty resolution of other projects within the workspace by M2E.

So there are 2 solutions:

  1. Either close the other project in the workspace (a dependency of the project in error).
  2. Or disable workspace resolution by M2E on the project in error (right-click on the project, Maven --> Disable Workspace Resolution).

Obviously, if you need both projects open then option 2. is the way to go. The dependent project then takes the dependency from the local Maven repo, so to refresh it, you have to build and install the dependency into the local repo (mvn install).




回答2:


I have the same issue. Still didn't find any smart solution, but this sometimes works for me:

  • Close eclipse
  • Go to console and do a maven clean install with update flag "mvn clean install -U"
  • Reboot the computer (logging out and back in didn't help)
  • Start eclipse and refresh and rebuild your projects


来源:https://stackoverflow.com/questions/14868172/pom-xml-no-such-file-or-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!