如何将Maven项目转换为Web应用程序项目? [英] How to convert maven project to web application project?

查看:145
本文介绍了如何将Maven项目转换为Web应用程序项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将一个maven项目转换为一个web应用程序项目,它应该包含web.xml。我使用eclipse juno 4.2和m2e(maven integration for eclipse)插件软件。

I want to convert a maven project to a web application project, which should contain web.xml. I am using eclipse juno 4.2 with m2e (maven integration for eclipse) plugin software.

任何回复都将不胜感激。

Any reply would be appreciated.

推荐答案


  • 安装 m2e-wtp

  • 在您的pom.xml中,更改或添加 war 打包

  • 右键单击项目> Maven>更新项目

  • m2e-wtp将创建src / main / webapp文件夹并添加Dynamic Web项目Facet?手动添加WEB-INF文件夹下的src / main / webapp
  • 右键单击项目> Java EE工具>生成部署描述符存根
    它将在src / main / webapp / WEB-INF /

    • Install m2e-wtp
    • In your pom.xml, change or add the war packaging
    • right-click on project > Maven > Update project
    • m2e-wtp will create the src/main/webapp folder and add the Dynamic Web project Facet¤
    • manually add a WEB-INF folder under src/main/webapp
    • right-click on project > Java EE Tools > Generate Deployment Descriptor stub It will create a web.xml under src/main/webapp/WEB-INF/
    • ¤默认情况下,网络构面设置为2.5。如果需要,您应该在生成web.xml之前在项目属性> Project Facets下更新它。

      ¤ By default, the web facet is set to 2.5. You should update it, if needed, under project properties > Project Facets BEFORE generating the web.xml

      这篇关于如何将Maven项目转换为Web应用程序项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆