码迷,mamicode.com
首页 > Web开发 > 详细

创建Maven web项目时 出现 web.xml is missing and <failOnMissingWebXml> is set to true错误 pox.xml编译错误

时间:2020-01-21 15:54:35      阅读:79      评论:0      收藏:0      [点我收藏+]

标签:uil   tor   编译错误   div   ash   出现   span   conf   org   

今天创建一个maven项目 pom.xml出现如下错误:

 web.xml is missing and <failOnMissingWebXml> is set to true

这是因为你因为你WEB-INF下没有web.xml导致造成的

解决方案:

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

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

 1 <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>

 

创建Maven web项目时 出现 web.xml is missing and <failOnMissingWebXml> is set to true错误 pox.xml编译错误

标签:uil   tor   编译错误   div   ash   出现   span   conf   org   

原文地址:https://www.cnblogs.com/coder-wf/p/12221942.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!