m2eclipse 和 Eclipse WTP
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1822290/
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
m2eclipse and Eclipse WTP
提问by noplay
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.
我有一个非常大的工作区,总共有大约 30 个项目。我在 m2eclipse 中使用 Eclipse 3.5。我使用默认值检出我的 subversion 存储库,以便将项目导入我的工作区。
I create a Tomcat server instance, and publish my web project to the tomcat server. Sounds easy enough.
我创建了一个 Tomcat 服务器实例,并将我的 web 项目发布到 tomcat 服务器。听起来很容易。
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. 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.
我进入了 web 项目的属性,我注意到没有检查 Java EE 模块依赖项中的一些传递依赖项。我检查了它们,在我进行项目清理构建之前,一切似乎都正常工作,当 Java EE 模块依赖项由 Eclipse 自动重置时,因此我需要重新检查它们。这令人抓狂,我希望有某种方法可以在使用 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.
我应该提到,使用标准 Maven 构建工作得很好,并且所有内容都被适当地拉入生成的 WAR 文件中。出于某种原因,它对 WTP 的作用不是很好。
回答by Eugene Kuleshov
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
您需要确保安装了 m2eclipse 的“Maven 集成 WTP”功能。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.
您使用的是什么版本的 WTP 和 m2eclipse?检查项目的 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
如果以上方法没有帮助,请尝试在较小的项目上重现问题,然后提交错误报告
回答by noplay
It appears as though the latest version of m2eclipse (.99x) solves all of my issues.
似乎最新版本的 m2eclipse (.99x) 解决了我的所有问题。
回答by Jon Vaughan
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% 健壮。