使用Eclipse创建Maven Web工程


①创建Maven项目 
    注意:打钩 Create a simple project(skip archetype selection) → Next
使用Eclipse创建Maven Web工程
②Packaging要选择war  → 点击Finish
使用Eclipse创建Maven Web工程
③ 右键点击项目 → Properties → Project Facets
使用Eclipse创建Maven Web工程
④ 去掉Dynamic Web Modeule前面的打钩  → Apply
使用Eclipse创建Maven Web工程
⑤ 重新打钩Dynamic Web Modeule → 选择Servlet版本  →  点击“Further configuration available...”
使用Eclipse创建Maven Web工程
⑥设置Content directory → 打钩Generate web.xml deployment descriptor  → OK
使用Eclipse创建Maven Web工程
⑦ 最后点击Apply  → OK
使用Eclipse创建Maven Web工程
⑧ 查看项目变化 → 生成了web.xml文件
使用Eclipse创建Maven Web工程

相关文章: