1.找到maven-archetype-webapp jar包的位置
2.找到本地仓库的路径
3.找到maven-archetype-webapp.jar 文件路径有点长别点错了
4.用WinRAR打开 maven-archetype-webapp.jar(是打开而不是解压!)
5.找到web.xml,并删除web.xml
6.创建web.xml添加头版本,编码为UTF-8
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
</web-app>
保存后退出。
7. 把刚编写的web.xml 放入jar包中
完成之后创建maven-archetype-webapp项目时默认的web.xml就是你刚刚新建的web.xml