eclipse maven POM 第一行提示异常Could not initialize class org.apache.maven.plugin.war.util.WebappStructureSerializer
eclipse从2021-03版本更新为2021-06版本后,有些项目的POM文件第一行有Could not initialize class org.apache.maven.plugin.war.util.WebappStructureSerializer错误。
原因:POM中包含有maven-war-plugin插件,插件版本太低
<plugin>
<groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.4</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin>
解决:将插件的版本更新
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>3.3.1</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin>