Maven:打war时找不到web.xml文件

  • 问题描述Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project java-web-smbms: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)

  • 解决方法:pom.xml文件中指定maven打包路径

        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.2</version>
                    <configuration>
                        <!-- 指定web.xml的路径  -->
                        <webXml>web\WEB-INF\web.xml</webXml>
                        <!-- 指定jsp、js、css的路劲 -->
                        <warSourceDirectory>web</warSourceDirectory>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    
上一篇:三种远程部署war包检测


下一篇:部署jenkins docker