title: Spring Boot MVC Multi-Module Executeable jar
body: <p>I have a multimodule project, build with spring boot 1.1.7</p>
  
  <p>The structure is</p>
  
  <pre><code>+ parent
      + import
          + web
          + backend
  </code></pre>
  
  <p>My Parent Module will include kind of microservices, what I want to manage from my parent (dependencies what all use) and so on. In import/backend there is my batch business logic, in web there is a mvc application, from where I can start batch job.</p>
  
  <p>In Eclipse everything works fine for me, I can start the application from the Application.java file and application works.</p>
  
  <p>Now I wanted to execute that application by executing executable jar file, but I get following error message when try starting from console.</p>
  
  <pre><code>java -jar application.jar
  Kein Hauptmanifestattribut in application.jar
  </code></pre>
  
  <p>The jar is very small <strong>only 5kb</strong>, I didn't find any jars of 3 party dependencies in jar package. </p>
  
  <p>The Pom of Web-Module is like follows:</p>
  
  <pre><code>    &lt;project&gt;
  
          &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
          &lt;parent&gt;
              &lt;groupId&gt;at.company.bbsng&lt;/groupId&gt;
              &lt;artifactId&gt;bbsng-import&lt;/artifactId&gt;
              &lt;version&gt;0.1.0-SNAPSHOT&lt;/version&gt;
          &lt;/parent&gt;
  
          &lt;artifactId&gt;bbsng-import-web&lt;/artifactId&gt;
          &lt;name&gt;bbsng-import-web&lt;/name&gt;
          &lt;packaging&gt;jar&lt;/packaging&gt;
  
          &lt;properties&gt;
              &lt;start-class&gt;at.company.bbsng.dataimport.Application&lt;/start-class&gt;
          &lt;/properties&gt;
  
  
          &lt;dependencies&gt;
  
               &lt;!-- APPLICATION --&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;at.company.bbsng&lt;/groupId&gt;
                  &lt;artifactId&gt;bbsng-import-backend&lt;/artifactId&gt;
                  &lt;version&gt;${parent.version}&lt;/version&gt;
              &lt;/dependency&gt;
  
              &lt;!-- SPRING ... --&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
                  &lt;exclusions&gt;
                      &lt;exclusion&gt;
                          &lt;artifactId&gt;spring-boot-starter-logging&lt;/artifactId&gt;
                          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                      &lt;/exclusion&gt;
                  &lt;/exclusions&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-starter-log4j&lt;/artifactId&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
              &lt;/dependency&gt;
  
              ...
  
  
          &lt;/dependencies&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;/project&gt;
  </code></pre>
  
  <p>Pom of Import Module is:</p>
  
  <pre><code>&lt;project&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;at.company.bbsng&lt;/groupId&gt;
          &lt;artifactId&gt;bbsng&lt;/artifactId&gt;
          &lt;version&gt;0.1.0-SNAPSHOT&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;artifactId&gt;bbsng-import&lt;/artifactId&gt;
      &lt;name&gt;bbsng-import&lt;/name&gt;
      &lt;packaging&gt;pom&lt;/packaging&gt;
  
      &lt;modules&gt;
          &lt;module&gt;backend&lt;/module&gt;
          &lt;module&gt;web&lt;/module&gt;
      &lt;/modules&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>And Pom of Parent is:</p>
  
  <pre><code>&lt;project&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;at.company.bbsng&lt;/groupId&gt;
      &lt;artifactId&gt;bbsng&lt;/artifactId&gt;
      &lt;version&gt;0.1.0-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;pom&lt;/packaging&gt;
      &lt;name&gt;bbsng&lt;/name&gt;
      &lt;description&gt;BBS Next Generation Application Prototype&lt;/description&gt;
  
      &lt;properties&gt;
          &lt;java-version&gt;1.8&lt;/java-version&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;org.springframework.boot-version&gt;1.1.7.RELEASE&lt;/org.springframework.boot-version&gt;
      &lt;/properties&gt;
  
      &lt;modules&gt;
          &lt;!-- &lt;module&gt;backend&lt;/module&gt; --&gt;
          &lt;!-- &lt;module&gt;business&lt;/module&gt; --&gt;
          &lt;module&gt;import&lt;/module&gt;
          &lt;!-- &lt;module&gt;infra&lt;/module&gt; --&gt;
          &lt;!-- &lt;module&gt;log&lt;/module&gt; --&gt;
          &lt;!-- &lt;module&gt;rest&lt;/module&gt; --&gt;
      &lt;/modules&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
  
              &lt;!-- SPRING-BOOT ... --&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-dependencies&lt;/artifactId&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;version&gt;${org.springframework.boot-version}&lt;/version&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
  
              &lt;!-- JAVAX ... --&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;javax.validation&lt;/groupId&gt;
                  &lt;artifactId&gt;validation-api&lt;/artifactId&gt;
                  &lt;version&gt;1.1.0.Final&lt;/version&gt;
              &lt;/dependency&gt;
  
              &lt;!-- COMMONS ... --&gt;
  
              ...
  
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-release-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.5&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;tagBase&gt;
                          svn://svn.int.company.at/stmlf-repository/prototype/bbsng/tags
                      &lt;/tagBase&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;${java-version}&lt;/source&gt;
                      &lt;target&gt;${java-version}&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
  
      &lt;/build&gt;
  
      &lt;profiles&gt;
          &lt;profile&gt;
              &lt;id&gt;external&lt;/id&gt;
              &lt;build&gt;
                  &lt;resources&gt;
                      &lt;resource&gt;
                          &lt;directory&gt;src/main/resources&lt;/directory&gt;
                          &lt;excludes&gt;
                              &lt;exclude&gt;**/*custom*&lt;/exclude&gt;
                              &lt;exclude&gt;**/custom/*&lt;/exclude&gt;
                          &lt;/excludes&gt;
                      &lt;/resource&gt;
                  &lt;/resources&gt;
              &lt;/build&gt;
          &lt;/profile&gt;
      &lt;/profiles&gt;    
  
  &lt;/project&gt;
  </code></pre>
  
  <p>If you need further information please ask. Hope you can help me.</p>
  
  <p>Thank you very much.</p>