【发布时间】:2012-07-28 01:32:27
【问题描述】:
我有一个我之前创建并部署在 Tomcat7 中的 REST Web 服务。我想将它部署在 Jetty 上,按照 in a previous question 的建议,我创建了一个 Maven 项目并在那里复制了我的文件并配置了依赖项,我可以成功地从 eclipse 运行 Maven 安装。
这是我在 POM.xml 中的build 部分:
<build>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<dependentWarExcludes></dependentWarExcludes>
<webappDirectory>
WebContent
</webappDirectory>
</configuration>
</plugin>
</plugins>
</build>
我按照说明here 使用了maven jetty 插件(我不确定这是否需要)。这里的问题是如何从 Eclipse 中部署我的 maven 项目,以便我可以访问 http:localhost:8080/myproject 并查看我的项目是否正常工作?
编辑:
我以前在Tomcat上运行服务的方式是右键项目,点击Run As -> Run on server(在eclipse服务器中配置)
我正在使用 eclipse Indigo、Maven 3 和 jetty 8。我还使用 jersey 作为 Web 服务。
【问题讨论】:
标签: java eclipse web-services jetty maven-3