0
点赞
收藏
分享

微信扫一扫

war打包时 报错webxml attribute is required

千白莫 2022-03-31 阅读 45

解决办法(亲测可用)

1.检查这个文件和目录是否存在,如果不存在则建:webapp/WEB-INF/web.xml

For servlet container < 3, make sure ​​WEB-INF/web.xml​​ file exists.

Default location for web.xml is "/src/main/webapp/WEB-INF/web.xml"

2.加上如下插件,如果上面那个文件确实存在,再加上这个插件

For servlet container >=3, and NO ​​web.xml​​​ web application, declares the following ​​maven-war-plugin​​​ plugin, and set the ​​failOnMissingWebXml​​ option to false.

pom.xml

<build>
<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>

</plugins>
</build>
举报

相关推荐

0 条评论