m2eclipse和Eclipse WTP [英] m2eclipse and Eclipse WTP

查看:112
本文介绍了m2eclipse和Eclipse WTP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常大的工作空间,大约有30个项目在一起。我正在使用带有m2eclipse的Eclipse 3.5。我使用默认值检出我的subversion存储库,以便将项目导入我的工作区。



我创建一个Tomcat服务器实例,并将我的web项目发布到tomcat服务器。听起来很简单。



问题是,它似乎并没有像我的其他项目的传递依赖项被自动添加到容器中,所以当容器启动时我得到classnotfound异常等。



我进入了Web项目的属性,我注意到Java EE模块依赖关系不检查一些传递依赖关系。我检查它们,一切似乎都有效,直到我做一个项目干净的构建,当Java EE模块依赖关系被eclipse自动重置,所以我需要重新检查它们。这很疯狂,我希望有一些方法可以在使用Eclipse WTP时自动提取所有的传递依赖项。



我应该提到,使用标准的maven构建工作很好,所有的东西都被适当地拉入到生成的WAR文件中。

解决方案

你需要确保你有Maven集成为WTP功能安装了m2eclipse。 http://docs.sonatype.org/display/ M2ECLIPSE / WTP + mini + howto



您正在使用什么版本的WTP和m2eclipse?检查在项目的pom.xml中声明的依赖关系版本与在workspace项目中声明的版本匹配,并确保已启用工作区依赖关系解析。



此外,您可以尝试从项目弹出菜单中运行Maven / Update项目配置,并检查Maven控制台和Eclipse自己的日志中是否没有错误。



如果上述没有帮助,请尝试在较小的项目上重现问题,然后使用错误报告提交


I have a very large workspace with about 30 projects all together. I am using Eclipse 3.5 with m2eclipse. I check out of my subversion repository using the defaults in order to import the projects into my workspace.

I create a Tomcat server instance, and publish my web project to the tomcat server. Sounds easy enough.

The problem is that it does not appear as though the transitive dependencies for my other projects are being automatically added to the container, so when the container starts up I get classnotfound exceptions, etc.

I go into the web project's properties, and I notice that the Java EE Module Dependencies are NOT checked for some of the transitive dependencies. I check them, and everything seemingly works until I do a project clean build, when the Java EE Module Dependencies are automatically reset by eclipse, so I need to recheck them. This is maddening, and I was hoping there was some way to automatically pull in all of the transitive dependencies when working with Eclipse WTP.

I should mention, using standard maven build works just fine, and everything gets pulled in appropriately into the resulting WAR file. It just doesn't work so good with WTP for some reason.

解决方案

You need to make sure that you have "Maven integration for WTP" feature from m2eclipse installed. There is a simple tutorial available at http://docs.sonatype.org/display/M2ECLIPSE/WTP+mini+howto

What version of WTP and m2eclipse you are using? Check that dependency version declared in project's pom.xml matches with version declared in workspace project and make sure that workspace dependency resolution is enabled.

Also, you can try to run "Maven / Update project configuration" from the project popup menu and check that there is no errors on Maven console and in Eclipse's own log.

If the above won't help, try to reproduce issue on a smaller project and then submit it with a bug report

这篇关于m2eclipse和Eclipse WTP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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