maven with eclipse error“Path必须包含项目和资源名称” [英] maven with eclipse error "Path must include project and resource name"

查看:215
本文介绍了maven with eclipse error“Path必须包含项目和资源名称”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始在eclipse中使用maven。

I've recently started using maven with eclipse.

我已经设置了几个项目,我注意到如果我尝试指定一个构建目录(在项目目录之外的覆盖目标,我在执行更新项目时遇到错误:

I've set up several projects and I've noticed that if I try and specify a build directory (to over-ride target) which is outside the project directory, I get an error when doing "update project":

'更新Maven项目'遇到了问题。

'Updating Maven Project' has encountered a problem.

在更新MAven项目期间发生内部错误。
路径必须包含项目和资源名称:/ [我的项目名称]

An internal error occurred during: "Updating MAven Project". Path must include project and resource name: /[my project name]

我需要在项目之外构建。我怎么能绕过这个?我可以让maven自动创建一个软链接吗?

I need to build outside the project. How can I get around this? Can I perhaps have maven automatically create a softlink?

推荐答案

虽然这是一个相当老的线程,但我最近遇到了这个问题,能够解决它。 maven抛出此错误的原因是我在 pom.xml 文件中的某个地方,这个绝对路径与项目导入到eclipse的目录不一致。所以我有两个绝对路径(一个不正确,或指向前一个位置)指向资源,即 project.build.outputDirectory ,在中pom.xml file。

Although this is a fairly old thread, I recently encountered this problem and was able to solve it. The reason why maven threw this error is I had, somewhere in my pom.xml file, an absolute path that was not consistent with the directory from which the project was imported into eclipse. So I had two absolute paths (one incorrect, or points to a previous location) that point to resources, i.e. project.build.outputDirectory, in the pom.xml file.

解决方案:找到错误的绝对路径, / home / userA / ProjectB / bin ,并替换为相对的 ./ bin ,路径。在eclipse中更新项目,你应该没问题。

The Solution: Locate the faulty absolute path, /home/userA/ProjectB/bin, and replace with a relative, ./bin, path. Update the project in eclipse and you should be fine.

这篇关于maven with eclipse error“Path必须包含项目和资源名称”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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