Could not initialize class org.apache.maven.plugins.war.util.WebappStructureSerializer

The first line of pom.xml reports an error: Could not initialize class org.apache.maven.plugins.war.util.WebappStructureSerializer. Although it does not affect the normal compilation and operation of the project, the red cross save is always a bit disgusting. The reason for this error is Eclipse Compatibility with the version of the Maven plugin (maven-war-plugin). After eclipse is updated from version 2021-03 to version 2021-06, this error will appear if the version of Maven is still in version 2.x. When Eclipse creates a project, a default version will be used. So the solution is to specify the version of maven-war-plugin in pom.xml. If it is saved due to the upgrade of Eclipse or STS4, and the original Maven plug-in also has a version number, just change the version number of the Maven plug-in to a higher one.
insert image description here

Guess you like

Origin blog.csdn.net/ren365880/article/details/128658996