新建Maven工程,pom.xml报错web.xml is missing and is set to true

JAVA学习网 2018-09-19 06:00:13

错误原因: 项目中没有web.xml

解决办法:

  1.  在项目中添加web.xml
  2. 在pom.xml中添加下面的插件
 1  <build>
 2   <plugins>
 3    <plugin>
 4     <groupId>org.apache.maven.plugins</groupId>
 5     <artifactId>maven-war-plugin</artifactId>
 6     <version>2.6</version>
 7     <configuration>
 8      <failOnMissingWebXml>false</failOnMissingWebXml>
 9     </configuration>
10    </plugin>
11   </plugins>
12  </build>

 

阅读(2389) 评论(0)