maven 部署模块报web.xml丢失异常

报错信息:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:w
ar (default-war) on project hibeauty-web: Error assembling WAR: webxml attribute
is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1]

修改方法:
在主pom.xml中的<build><plugins>标签下,添加这个plugin
<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.1.1</version>
            <configuration>
                <failOnMissingWebXml>false</failOnMissingWebXml>
            </configuration>
        </plugin>

或者在每一个不需要web.xml的pom中添加以上代码,其中version可以变,注意如果是war包则用maven-war-plugin,否则用maven-jar-plugin,主要看pom中<packaging>war</packaging>对应的是什么

你可能感兴趣的:(maven 部署模块报web.xml丢失异常)