pom.xml没有这样的文件或目录 [英] pom.xml no such file or directory

查看:593
本文介绍了pom.xml没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在构建项目时遇到问题.我在Linux平台上使用springsource工具(STS)版本3.1.0.将项目导入STS之后,springsource工具告诉我pom.xml文件中没有这样的文件或目录".该文件实际上存在于正确的路径中.我认为该项目运行良好,因为我尝试在另一台计算机上以相同的过程导入相同的项目.

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.

当我使用控制台用maven编译项目时,所有这些都被成功编译了.

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

我也尝试了以下方法,但仍然无法使用: 1.重新安装STS. 2.重新导入项目. 3.创建用户个人资料并重新导入项目. 4.使用旧版本的STS(3.0.0)

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!

推荐答案

Eclipse Luna SR1中pom.xml出现没有这样的文件或目录"错误.

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

通过M2E跟踪归因于工作空间中其他项目的错误解析.

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

因此,有两种解决方案:

So there are 2 solutions:

  1. 关闭工作区中的另一个项目(错误的项目依赖项).
  2. 或在错误的项目上通过M2E禁用工作空间解析(右键单击该项目,Maven->禁用工作空间解析).

很显然,如果您需要打开两个项目,那么选择方法2.然后,依赖项目会从本地Maven存储库中获取依赖关系,因此要刷新它,您必须将依赖关系构建并安装到本地存储库中(mvn install).

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).

这篇关于pom.xml没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆