maven中出现web.xml is missing and <failOnMissingWebXml> is set to true的错误如何解决
2017-08-16 17:33
786 查看
在建立一个new maven project 的时候,create simple成功简历一个maven项目的时候会出现一个错误;
web.xml is missing and <failOnMissingWebXml> is set to true;
解决方法如下:
在src/main/webapp/下新建一个WEB-INF文件,并且在WEB-INF文件下建立一个web.xm;如图
web.xml内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> <display-name>Archetype Created Web Application</display-name>
</web-app>
但是仍然还是报这个错误,需要两步操作
1)右击项目,打开Properties对话框,点击Deployment Assembly选项,在右边添加一个文件夹,并且保存设置
2)在eclispe上方点击Project ->Clean 清理一下这个项目;
方法二:
添加配置,放过该错误提示
[xml] view
plain copy
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
web.xml is missing and <failOnMissingWebXml> is set to true;
解决方法如下:
在src/main/webapp/下新建一个WEB-INF文件,并且在WEB-INF文件下建立一个web.xm;如图
web.xml内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> <display-name>Archetype Created Web Application</display-name>
</web-app>
但是仍然还是报这个错误,需要两步操作
1)右击项目,打开Properties对话框,点击Deployment Assembly选项,在右边添加一个文件夹,并且保存设置
2)在eclispe上方点击Project ->Clean 清理一下这个项目;
方法二:
添加配置,放过该错误提示
[xml] view
plain copy
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
相关文章推荐
- maven项目出现web.xml is missing and <failOnMissingWebXml> is set to true错误的解决办法
- maven项目出现web.xml is missing and <failOnMissingWebXml> is set to true错误的解决办法
- 创建Maven web项目时 出现 web.xml is missing and <failOnMissingWebXml> is set to true错误 pox.xml编译错误
- 创建Maven web项目时 出现 web.xml is missing and <failOnMissingWebXml> is set to true错误 pox.xml编译错误
- 创建Maven web项目时 出现 web.xml is missing and <failOnMissingWebXml> is set to true错误 pox.xml编译错误
- Eclipse创建Maven项目时提示web.xml is missing and <failOnMissingWebXml> is set to true错误解决方案
- web.xml is missing and <failOnMissingWebXml> is set to true 错误解决办法
- poe.xml 出现web.xml is missing and <failOnMissingWebXml> is set to true的错误
- 创建Maven项目时提示web.xml is missing and <failOnMissingWebXml> is set to true错误解决方案
- pom.xml项目文件中出现web.xml is missing and <failOnMissingWebXml> is set to true解决方法
- 创建Maven项目时提示web.xml is missing and <failOnMissingWebXml> is set to true错误解决方案
- Maven搭建项目出现web.xml is missing and <failOnMissingWebXml> is set to true
- eclipse新建maven项目:pom.xml出现web.xml is missing and <failOnMissingWebXml> is set to true解决方案
- maven 遇到failOnMissingWebXml有关问题解决方法:web.xml is missing and <failOnMissingWebXml> is set to true
- 创建Maven项目时提示web.xml is missing and <failOnMissingWebXml> is set to true错误解决方案
- 创建Maven项目时提示web.xml is missing and <failOnMissingWebXml> is set to true错误解决方案
- maven 的pom出现web.xml is missing and <failOnMissingWebXml> is set to true
- pom.xml出现web.xml is missing and <failOnMissingWebXml> is set to true解决方案
- maven 的pom.xml 配置异常web.xml is missing and <failOnMissingWebXml> is set to true
- pom.xml出现web.xml is missing and <failOnMissingWebXml> is set to true解决方案