在动态 Web 项目中使用 m2e 插件

发布于 2024-12-27 15:11:16 字数 223 浏览 1 评论 0原文

我在 Eclipse Indigo 中有一个现有的动态 Web 项目,并安装了 m2e 插件。在我不太记得的 Eclipse 设置的另一个版本中(我的硬盘崩溃了),我可以右键单击该项目 -> Maven->启用依赖管理。

在我当前的 Eclipse 版本中,我的动态 Web 项目的此菜单已消失。现在该怎么走?我尝试右键单击项目文件夹 ->配置->转换为 Maven 项目,但失败并出现错误。

I have an existing Dynamic Web Project in Eclipse Indigo and the m2e plugin installed. In another version of my eclipse setup that I dont quite remember (my hdd crashed) I could just right click on the project -> Maven -> Enable Dependency Management.

This menu is gone for my Dynamic Web Project in my current eclipse version. Whats the way to go now? I tried right click on the project folder -> configure -> convert to maven project but that fails with errors.

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

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

发布评论

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

评论(2

奶茶白久 2025-01-03 15:11:16

M2Eclipse 已从 Sonatype 迁移到名为 m2e 的 Eclipse 项目。因此,在 Eclipse Indigo 中,您已经安装了 m2e,而旧 Eclipse 版本中的旧 Maven 项目是根据右键单击描述使用 M2Eclipse 创建的。现在,在正常情况下,一切都应该完美无缺,我们不会进行这种讨论。不幸的是,随着项目的移动,命名空间已从 org.maven.ide.eclipse 更改为 org.eclipse.m2e.core ,并且使用 M2Eclipse 创建的旧 Maven 项目不再适用立即被认为是 m2e 中的 Maven 项目。 这里描述如何相应地迁移项目。

M2Eclipse has migrated to an Eclipse project from Sonatype called m2e. Therefore in you Eclipse Indigo you have installed m2e whereas your old Maven projects in the older Eclipse version were created with M2Eclipse according to your right-click description. Now under normal circomstances everything should be working flawlessly and we wouldn't have this discussion. Unfortunately with the move of the project the namespace has changed from org.maven.ide.eclipse to org.eclipse.m2e.core and old Maven projects created with M2Eclipse are not immediately recognised as Maven projects in m2e. Here's a description of how to migrate your projects accordingly.

时光无声 2025-01-03 15:11:16

Erik,导入现有的 Maven 项目将使 m2e 发现并建议您安装 m2e-wtp,即 Eclipse WTP 插件的 Maven 集成。由于您是从头开始,因此您应该自己安装 m2e-wtp (请参阅 https://github。 com/sonatype/m2eclipse-wtp/wiki)。

现在,为了快速启动新的 Maven 化 Web 项目,您应该转到“新建项目”菜单并选择新的 Maven 项目。
此时,您可以选择创建一个“简单”项目,在这种情况下,您需要在接下来的屏幕上选择“war”打包,或者使用 Maven 原型,这将快速启动一个新的预配置 Web 项目,其风格为你想要(jsf,spring ...)。 m2e-wtp wiki 提供了可帮助您入门的链接。

注意:此时 Eclipse 到 Maven 的转换几乎不存在(仅创建一个裸露的 pom.xml),这就是为什么我建议首先创建一个 Maven 项目。希望这在下一个 m2e 1.1(2012 年 6 月)中会变得更好

Erik, importing an existing maven project would let m2e discover and propose you to install m2e-wtp, the Maven Integration for Eclipse WTP plugin. Since you're starting from scratch, you should install m2e-wtp yourself (see https://github.com/sonatype/m2eclipse-wtp/wiki).

Now in order to quickstart a new mavenized web project, you should go to the "New Project" menu and choose new Maven project.
At this point, either you choose to create a "simple" project, in which case you need to select the "war" packaging on the following screen, or use a maven archetype, which will quickstart a new preconfigured web project, with the flavor you want (jsf, spring ...). The m2e-wtp wiki has links to help you get started.

Note : at this point Eclipse to Maven conversion is pretty much inexistant (only creates a bare pom.xml), that's why I recommend to create a maven project first. Hopefully, this should get better in the next m2e 1.1 (June 2012)

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