Eclipse 中的 Maven 2 项目错误图标
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7156101/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Maven 2 project error icon in Eclipse
提问by Chandana
I have create multi-module maven project in Eclipse IDE (already installed M2Eclipse plugin). There I can build my project successfully. But after build also it shows errors icon in my every module project. What kind of issue it can be?
我在 Eclipse IDE 中创建了多模块 maven 项目(已经安装了 M2Eclipse 插件)。在那里我可以成功构建我的项目。但是在构建之后,它也会在我的每个模块项目中显示错误图标。它可能是一个什么样的问题?
Thank You.
谢谢你。
回答by CoolBeans
Without knowing what errors you are seeing I am going to assume that your issue is with eclipse project properties (build path, src directory specification, output classes directory, etc).
在不知道您看到什么错误的情况下,我将假设您的问题与 eclipse 项目属性(构建路径、src 目录规范、输出类目录等)有关。
You tagged m2eclipse plugin, so you should be able to right click on your project in eclipse select maven->update project configuration
. If you do not see that option under maven then you should first see an option called maven->enable dependency management
. Click that first and then you should be able to see update project configuration option.
您标记了 m2eclipse 插件,因此您应该可以在 eclipse select 中右键单击您的项目maven->update project configuration
。如果您在 Maven 下没有看到该选项,那么您应该首先看到一个名为maven->enable dependency management
. 首先单击它,然后您应该能够看到更新项目配置选项。
If this does not fix it, then open your project directory containing the pom.xml file in command prompt and run mvn eclipse:eclipse
.
如果这不能解决问题,请在命令提示符下打开包含 pom.xml 文件的项目目录并运行mvn eclipse:eclipse
.
One of the above should resolve those pesky error messages provided that your maven build itself is successful.
如果您的 Maven 构建本身成功,上述方法之一应该可以解决那些讨厌的错误消息。
回答by Kowser
In eclipse open the Markers Tab (You can open it from Window -> Show View -> searching Markers)
在 Eclipse 中打开标记选项卡(您可以从窗口 -> 显示视图 -> 搜索标记打开它)
It will show all the related errors with your project. You can identify your problems related to your problem, and solve accordingly. Sometimes it shows Quick Fix
option, which is helpful.
它将显示与您的项目相关的所有错误。您可以识别与您的问题相关的问题,并相应地解决。有时它会显示Quick Fix
选项,这很有帮助。