25

I'm trying out the next version of Eclipse using the latest milestone build and I'm having an issue getting my Maven project deployed to Tomcat.

Previously in Eclipse 3.6, my project was automatically enabled as a web project when checked out from SVN. I've checked out my project in 3.7 but get nothing indicating it's runnable as a web project (e.g. trying to run the project doesn't give me the usual "Run on Server" option).

What I've installed is Indigo RC4 "Eclipse IDE for Java EE Developers" version. I then added the latest M2E milestone from here. This enabled me to get up and running, check out my project and I seem to be able to build the project fine (which does create my .war file for remote deployment). Still no "Run On Server" options though.

Does anyone have any clues on what I could be missing? I'm guessing it's a Maven & WTP integration plugin but I haven't spotted the right one yet.

4

2 回答 2

46

在 m2e 成为 Eclipse 项目之前,WTP 集成与核心模块一起提供。现在核心模块是一个 eclipse 模块,并且 WTP 集成是单独提供的。m2eclipse-wtp 的当前 Indigo 快照可在此处找到。但是,我无法从此更新站点获取任何工件,即使它已在相应的 JIRA问题中列出。

幸运的是,今天 m2e-wtp 可以通过 m2e 市场获得。只需打开 Eclipse 首选项,转到“Maven”->“发现”->“打开目录”并安装它。m2e 市场.

于 2011-06-23T15:37:48.337 回答
21

它将与 lastet 版本一起使用,只是 .project 不正确。

只需进入项目属性,使项目多面.. 勾选动态 Web 模块,然后您将在服务器上运行作为选项。 更新项目方面

这将启用“在服务器上运行”选项,但是您的问题并没有在那里完成,因为当您运行它时,您将得到 404。

要解决此问题,请返回项目属性部署程序集。

部署组装

删除 WebContent 条目(您也可以稍后删除项目中的文件夹),并确保添加了 src-main-webapp 和 src-main-resource 文件夹。

Bingo .. 运行应用程序,它应该没问题。

于 2011-07-12T12:46:08.087 回答