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>

添加后即可打包。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM