Home > Software engineering >  Why would upgrading from Java 8 to Java 17 require me to use the maven-war-plugin?
Why would upgrading from Java 8 to Java 17 require me to use the maven-war-plugin?

Time:06-07

I am upgrading a project from Java 8 to Java 17 and I am receiving the error (in a pom.xml file) "Could not initialize class org.apache.maven.plugin.war.util.WebappStructureSerializer". I have updated the other dependencies in the pom file as part of the upgrade process as well. I have seen in other stack overflow posts that say this could mean one should update the maven-war-plugin. The thing is, I am not currently using that plugin. When I add it, it does fix the issue, but I am just wondering why that would be.

CodePudding user response:

I suspect the following happened.

When you build a WAR, then the Maven War Plugin is called implicitly (you can see that in the logs).

For some reason, the version was older than the newest available version (maybe a caching problem, maybe parent POM etc.). By explictly setting the version of the Maven War Plugin, this problem vanishes.

  • Related