简体   繁体   English

m2eclipse和Eclipse WTP

[英]m2eclipse and Eclipse WTP

I have a very large workspace with about 30 projects all together. 我有一个非常大的工作空间,大约有30个项目。 I am using Eclipse 3.5 with m2eclipse. 我正在使用带有m2eclipse的Eclipse 3.5。 I check out of my subversion repository using the defaults in order to import the projects into my workspace. 我使用默认值检查我的subversion存储库,以便将项目导入我的工作区。

I create a Tomcat server instance, and publish my web project to the tomcat server. 我创建了一个Tomcat服务器实例,并将我的web项目发布到tomcat服务器。 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. 问题是它看起来好像我的其他项目的传递依赖关系被自动添加到容器中,所以当容器启动时我得到classnotfound异常,等等。

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. 我进入了Web项目的属性,我注意到没有检查Java EE模块依赖项的某些传递依赖项。 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. 我检查它们,一切看似有效,直到我做一个项目干净的构建,当eclipse自动重置Java EE模块依赖项时,所以我需要重新检查它们。 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. 这很令人发狂,我希望在使用Eclipse WTP时有一些方法可以自动提取所有传递依赖项。

I should mention, using standard maven build works just fine, and everything gets pulled in appropriately into the resulting WAR file. 我应该提一下,使用标准的maven构建工作就好了,所有内容都被适当地拉入到生成的WAR文件中。 It just doesn't work so good with WTP for some reason. 由于某些原因,WTP的效果不好。

You need to make sure that you have "Maven integration for WTP" feature from m2eclipse installed. 您需要确保已安装m2eclipse的“Maven集成WTP”功能。 There is a simple tutorial available at http://docs.sonatype.org/display/M2ECLIPSE/WTP+mini+howto http://docs.sonatype.org/display/M2ECLIPSE/WTP+mini+howto提供了一个简单的教程。

What version of WTP and m2eclipse you are using? 你正在使用什么版本的WTP和m2eclipse? 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. 检查在项目的pom.xml中声明的依赖项版本是否与在工作区项目中声明的版本匹配,并确保启用了工作区依赖项解析。

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. 此外,您可以尝试从项目弹出菜单中运行“Maven / Update project configuration”,并检查Maven控制台和Eclipse自己的日志中是否存在错误。

If the above won't help, try to reproduce issue on a smaller project and then submit it with a bug report 如果上述方法无效,请尝试在较小的项目上重现问题,然后使用错误报告提交

似乎最新版本的m2eclipse(.99x)解决了我的所有问题。

If you are tempted to use m2eclipse wtp extras you need to be aware that they are not supported by Sonatype and, although mostly OK, are not 100% robust. 如果您想要使用m2eclipse wtp extras,您需要注意Sonatype不支持它们,尽管大多数情况下都不是100%健壮。

See http://maven.40175.n5.nabble.com/What-is-the-recommended-alternative-to-m2eclipse-extras-WTP-integration-td135727.html http://maven.40175.n5.nabble.com/What-is-the-recommended-alternative-to-m2eclipse-extras-WTP-integration-td135727.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM