错误:web.xml is missing and is set to true

错误:web.xml is missing and is set to true

这时候需要右击项目——>Java EE Tools——>Generate Deployment Descriptor Stub.然后系统会在src/main/webapp/WEB_INF文件加下创建web.xml文件。错误解决!

当然这个方法是针对web项目的解决方案,如果你的工程不是web项目,那么还有另外一种解决方案,就是在pom文件中配置一下failOnMissingWebXml。具体配置如下:

<build>
 2 
 3   <plugins>
 4 
 5    <plugin>
 6 
 7     <groupId>org.apache.maven.plugins</groupId>
 8 
 9     <artifactId>maven-war-plugin</artifactId>
10 
11     <version>2.6</version>
12 
13     <configuration>
14 
15      <failOnMissingWebXml>false</failOnMissingWebXml>
16 
17     </configuration>
18 
19    </plugin>
20 
21   </plugins>
22 
23  </build>

猜你喜欢

转载自blog.csdn.net/qq_40247975/article/details/81699739