版本:
eclipse:2022-03 (4.23.0)
maven:apache-maven-3.5.4
jdk:1.8
正文:
最近用最新的eclipse创建maven项目时发现pom第一行报错,Could not initialize class org.apache.maven.plugin.war.util.WebappStructureSerializer,见下图
于是经过研究,亲测在pom.xml中最下端加了如下配置解决报错问题:
<build>
<finalName>maven.plugins</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>
在pom.xml中添加完成以后,保存,然后右键当前项目找到Maven->Update Project,然后这个错误就解决了