Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not initialize class org.apache.maven.plugin.war.util.WebappStructureSerializer -Maven Configuration Problem Any solution?

When I am creating a Maven project I am getting this error in pom.xml

Could not initialize class org.apache.maven.plugin.war.util.WebappStructureSerializer
-Maven Configuration Problem

like image 543
asmi Avatar asked Jul 15 '21 15:07

asmi


3 Answers

It might because the version of maven-war-plugin is too old in your project.

Try to add below code in your pom.xml

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>3.3.1</version>
</plugin>
like image 173
Michael Ouyang Avatar answered Oct 09 '22 00:10

Michael Ouyang


<build>
      <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>3.3.1</version>
        </plugin>
    </plugins>
    <finalName>check</finalName>
  </build>
</project>

Note: you should have the build tag place everything inside build tag then, it will not throw error

like image 11
Anddy Avatar answered Oct 08 '22 23:10

Anddy


If you are getting this error within Eclipse (my Eclipse version was Version: 2021-09 (4.21.0), Build id: 20210910-1417 at the time of writing) and you recently tried to move to JDK 17, it appears Eclipse is not compatible with JDK 17. It requires at least JDK 11. I reverted back to Java 11.0.12 and the error has gone away.

like image 11
Capricorn1 Avatar answered Oct 09 '22 00:10

Capricorn1