Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project zhby-pms-platform: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)
这个是具体的错误,网上搜了搜大部分都是需要配置web war包的版本属性,最终我这解决是这样解决的 顺带附上打war包的大体配置

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.4.RELEASE</version>
<relativePath />
</parent>
<build>
<finalName>pms-platform</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.abc.Application</mainClass>
<includeSystemScope>true</includeSystemScope>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
</plugin>
</plugins>
</build>
这篇博客讲述了在遇到Maven WAR插件打包时出现'webxml attribute is required'错误的解决过程。问题最终通过调整Spring Boot Maven插件的配置得到解决,包括设置mainClass和includeSystemScope属性,并确保了正确的Maven插件版本。此外,还展示了完整的Maven配置片段。
2243

被折叠的 条评论
为什么被折叠?



