title: Why Maven throws error like `must be "pom" but is "jar"`?
body: <p>I need to fix below maven error.</p>
  
  <p>When I run:</p>
  
  <blockquote>
    <p>mvn clean install</p>
  </blockquote>
  
  <p>I get :</p>
  
  <pre><code>[ERROR] The build could not read 1 project -&gt; [Help 1]
  org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
  [ERROR] Invalid packaging for parent POM org.springframework.boot:spring-boot-starter-parent:2.0.5.RELEASE, must be "pom" but is "jar" @ org.springframework.boot:spring-boot-starter-parent:2.0.5.RELEASE
  [ERROR] 'packaging' with value 'jar' is invalid. Aggregator projects require 'pom' as packaging. @ line 3, column 102
  </code></pre>
  
  <p>This is my package hierarchy:</p>
  
  <pre><code>.
  ├── pom.xml
  |
  └── application
      └── pom.xml
  </code></pre>
  
  <p>Below is my pom in root:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.tim.project&lt;/groupId&gt;
      &lt;artifactId&gt;myservice&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;${project.artifactId}-${project.version}&lt;/name&gt;
      &lt;description&gt;My Service&lt;/description&gt;
      &lt;packaging&gt;pom&lt;/packaging&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;/properties&gt;
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.0.5.RELEASE&lt;/version&gt;
          &lt;relativePath/&gt;
      &lt;/parent&gt;
  
      &lt;modules&gt;
          &lt;module&gt;application&lt;/module&gt;
      &lt;/modules&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>Below is my pom in application folder:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
           xmlns="http://maven.apache.org/POM/4.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
  
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.tom.project&lt;/groupId&gt;
      &lt;artifactId&gt;myservice-application&lt;/artifactId&gt;
      &lt;version&gt;0.0.2&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;/properties&gt;
  
      &lt;repositories&gt;
          &lt;repository&gt;
            ...
          &lt;/repository&gt;
      &lt;/repositories&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-cloud-sleuth&lt;/artifactId&gt;
                  &lt;version&gt;2.0.0.RC1&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.springframework.boot&lt;/groupId&gt;
            &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
            &lt;scope&gt;compile&lt;/scope&gt;
        &lt;/dependency&gt;
        ....
        ....
  
      &lt;/dependencies&gt;
  
  &lt;/project&gt;
  </code></pre>