解决Maven导出war包时报错Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-wa

通过Maven导出war包时报错:Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project Ocr: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1]

提示已经说得很清楚了,系统没有找到 WEB-INF/web.xml文件,所以你需要在项目的main文件夹下,也就是和java的统计目录新建webapp文件夹,再在里面新建WEB-INF文件夹,最后在WEB-INF文件夹下新建web.xml文件,xml文件中不需要配置内容。

解决Maven导出war包时报错Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-wa_第1张图片

执行maven的clean命令,然后执行package命令,BUILD SUCCESS!

你可能感兴趣的:(Java)