Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)

在IDEA中对SpringBoot项目打包maven打war包项目的时候提示:

Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)

原因是它会找web.xml文件,而对于SpringBoot项目,它默认删除了此文件。

解决办法是在pom中添加一个插件来打包:

<plugin>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-war-plugin</artifactId>
     <version>3.2.0</version>
</plugin>

添加后即可打包。

posted @ 2021-12-09 20:41  钟小嘿  阅读(1930)  评论(0编辑  收藏  举报