m2Eclipse插件用maven 3.0.3,没有编译错误,jre5用jdk7
关于 m2 eclipse 插件的问题。目前我有“Eclipse Java EE IDE for Web Developers”,这是最新的更新。我安装了 m2 eclipse 插件,并启动了一个正常的 java 项目。然后我通过
“右键->配置->转换为maven项目”将其转换为maven 项目 这似乎有效,创建了 pom.xml,项目进行了转换,一切都很好。
当我对这个项目做任何事情时,问题就开始了。在项目的 Maven 设置中“项目上的正确客户端 -> maven”有几个行为异常的选项,更新 Maven 配置会将项目的默认 JDK (JDK7) 更改为 j2SE-1.5...,这是机器上从来没有安装过,当然也找不到。此外,代码完成和错误检查在编辑器中不起作用。
例子: params.put("some_string", );对于编译错误,这应该呈现“红色”,因为 put() 没有第二个参数,但是根据 Eclipse 编辑器,这检查为正常。
我对这个问题做了一些研究,从我从 Google 收集到的信息来看,m2eclipse 和这个 eclipse 发行版似乎存在一些问题,但是没有什么可以解决这个问题。其他人有类似的问题吗,或者有人知道如何解决这个问题吗?
如果我可以提供任何其他信息,请告诉我,我不想只是将我的 settings.xml 粘贴到堆栈溢出中。
注意:我在 Eclipse 中配置了 settings.xml,并指定了要使用的 jdk (7)
系统信息: Maven版本:3.0.3 Eclipse 版本:适用于 Web 开发人员的 Eclipse Java EE IDE 版本
截至本文发布日期,所有 Eclipse 插件均安装了最新版本,并且不存在 XML 完整性错误或任何此类错误。
Question about the m2 eclipse plugin. Currently I have "Eclipse Java EE IDE for Web Developers", the most recent update. I have the m2 eclipse plugin installed, and have started a normal java project. I then converted this to a maven project via
"right click->configure->convert to to maven project"
This appears to work, a pom.xml is created, the project converts, and everything is well and good.
The issue starts when I do anything to this project. In the maven settings for the project "Right client on project -> maven" there are several options that are behaving strangely, updating maven configuration will change the default JDK for the project (JDK7) to j2SE-1.5..., which was never installed on the machine, and of course is not found. Also code completion, and and error checking is not working in the editor.
Example:
params.put("some_string", ); This should render "red" for compilation errors because there is no second argument to put(), however this checks out as okay according to the eclipse editor.
I have some done some research on this issue, and from what I can gather from Google, it appears that there are some issues with m2eclipse and this distro of eclipse however there is nothing to resolve this. Is anybody else having similar problems, or does anybody have any idea how to resolve this?
Please let me know if the is any other information I can provide, I didn't want to just paste my settings.xml into stack overflow.
Note: I have my settings.xml configured in Eclipse, and have specifies which jdk to use (7)
System information:
Maven version: 3.0.3
Eclipse Version: Eclipse Java EE IDE for Web Developers Version
All eclipse plugins have the most recent versions installed as of this post date, and there are no XML integrity errors, or anything of the sort.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于 JDK 问题:在 pom.xml 中指定
,然后执行另一个“更新项目配置”。然后应该设置 JDK 7(至少对我有用)。
For the JDK issue: in your pom.xml specify
and then do another "Update Project configuration". Then the JDK 7 should be set (at least works for me).
好的,这个问题的答案就是 Stack Overflow 和其他网站上许多其他问题的答案......“mvn eclipse:eclipse”。我的印象是 Eclipse 在项目启动时“为你做了这件事”,但事实显然并非如此。在 Eclipse 重新安装(新计算机)后在全新的工作空间上运行后,一切正常。
我觉得有必要结束这个。不过还是谢谢你的帮助。
Okay, so the answer to this is the answer to so many other questions on Stack overflow and other sites.... "mvn eclipse:eclipse". I was under the impression that Eclipse "did this for you" on project startup, and that is apparently not the case. After running that on a brand new work-space after an eclipse re-install (new computer) everything works fine.
I felt the need to close this one out. Thanks for the help though.