title: "Could not initialize class..." error in pom.xml with a new Maven project
body: <p>I wanted to learn how to develop RESTful APIs with JAX-RS and so started with an example covered in one of the YouTube videos. The video was created 5 -6 years ago and used Tomcat 7 and an older version of Eclipse. But I installed the recent versions of Tomcat (10.0.6) and Eclipse (jee-2021-03) and followed the tutorial.</p>
  <p>I created a new maven project with the following archetype:
  <strong>Group Id</strong>: org.glassfish.jersey.archetypes
  <strong>Artifact Id</strong>: jersey-quickstart-webapp
  <strong>Version</strong>: 3.0.2</p>
  <p>I provided Group Id and Artifact Id for my project with default version 0.0.1-SNAPSHOT and clicked Finish.</p>
  <p>Eclipse created the project with the following 2 errors:</p>
  <ol>
  <li><strong>index.jsp</strong>: &quot;The superclass &quot;javax.servlet.http.HttpServlet&quot; was not found on the Java Build Path&quot;</li>
  <li><strong>pom.xml</strong>: &quot;Could not initialize class org.apache.maven.plugin.war.util.WebappStructureSerializer&quot; on the very first line.</li>
  </ol>
  <p>I'd appreciate if someone can help me understand why I'm getting these errors and how to resolve them.</p>
  <p>Here is my pom.xml.</p>
  <pre><code>&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
           xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot;&gt;
  
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.xyz.rest&lt;/groupId&gt;
      &lt;artifactId&gt;onlineshopping&lt;/artifactId&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;onlineshopping&lt;/name&gt;
  
      &lt;build&gt;
          &lt;finalName&gt;onlineshopping&lt;/finalName&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.8.1&lt;/version&gt;
                  &lt;inherited&gt;true&lt;/inherited&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.glassfish.jersey&lt;/groupId&gt;
                  &lt;artifactId&gt;jersey-bom&lt;/artifactId&gt;
                  &lt;version&gt;${jersey.version}&lt;/version&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.glassfish.jersey.containers&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-container-servlet-core&lt;/artifactId&gt;
              &lt;!-- use the following artifactId if you don't need servlet 2.x compatibility --&gt;
              &lt;!-- artifactId&gt;jersey-container-servlet&lt;/artifactId --&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.glassfish.jersey.inject&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-hk2&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;!-- uncomment this to get JSON support
          &lt;dependency&gt;
              &lt;groupId&gt;org.glassfish.jersey.media&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-media-json-binding&lt;/artifactId&gt;
          &lt;/dependency&gt;
          --&gt;
      &lt;/dependencies&gt;
      &lt;properties&gt;
          &lt;jersey.version&gt;3.0.2&lt;/jersey.version&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;/properties&gt;
  &lt;/project&gt;
  </code></pre>