方法一、配置pom.xml屏蔽web.xml
web.xml在高级版本中,已经可以通过注解替代,不是必须的文件了;所以可以直接设置不需要该文件。
如果你仍旧习惯该文件,可以采用方法二;
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
方法一、生成web.xml
you can do it also like this:
- Right click on Deployment Descriptor in Project Explorer.
- Select Generate Deployment Descriptor Stub.
It will generate WEB-INF folder in src/main/webapp and an web.xml in it.