m2eclipse 和 Eclipse WTP

发布于 2024-08-13 04:35:32 字数 488 浏览 7 评论 0原文

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

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

问题是,我的其他项目的传递依赖项似乎没有自动添加到容器中,因此当容器启动时,我会收到 classnotfound 异常等。

我进入 Web 项目的属性,我注意到不检查 Java EE 模块依赖关系中的某些传递依赖关系。我检查了它们,一切似乎都正常,直到我进行项目干净构建,此时 Java EE 模块依赖项会被 eclipse 自动重置,所以我需要重新检查它们。这太令人抓狂了,我希望有某种方法可以在使用 Eclipse WTP 时自动引入所有传递依赖项。

我应该提到,使用标准 Maven 构建效果很好,并且所有内容都会适当地放入生成的 WAR 文件中。由于某些原因,它与 WTP 的配合不太好。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

吃兔兔 2024-08-20 04:35:32

您需要确保安装了 m2eclipse 中的“Maven 集成 WTP”功能。有一个简单的教程,位于 http://docs.sonatype.org/display/ M2ECLIPSE/WTP+mini+howto

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

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

如果上述方法没有帮助,请尝试在较小的项目上重现问题,然后连同错误报告一起提交

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

三岁铭 2024-08-20 04:35:32

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

It appears as though the latest version of m2eclipse (.99x) solves all of my issues.

无敌元气妹 2024-08-20 04:35:32

如果您想使用 m2eclipse wtp extras,您需要注意 Sonatype 不支持它们,并且虽然大部分都可以,但不是 100% 健壮。

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

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.

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文