title: Maven Multi Module Spring Boot Project
body: <p>I am trying to create a multi module project that contains two module, core and web. They are both Spring Boot projects that I generated on Spring Initialzer. I setup the Maven POM files but I'm having issues getting it to deploy. However I am confused how the configuration is going to work.</p>
  
  <p>The core module is going to contain the domain object / entities, Spring Data JPA repositories, services, and will be packaged as a JAR. The Web module is going to have Spring Security, the controllers, and the views. It will be packaged as a WAR. </p>
  
  <p>The normal structure of a Spring Boot project looks like the following</p>
  
  <pre><code>/
  pom.xml
  src/
  ..main/
  ....com/
  ......example/
  ........app/
  ..........Application.java
  ..resources/
  ....application.properites
  </code></pre>
  
  <p>I essentially have two of these and two Spring Boot application / configuration / initialization classes. </p>
  
  <p>My questions are</p>
  
  <ol>
  <li><p>Do the properties have to live in a single configuration file or can I have two application.properities, one the core jar, and one for the WAR?</p></li>
  <li><p>Can I have the following in my core.jar</p>
  
  <pre><code>import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  
  @SpringBootApplication
  public class TimesheetCoreApplication {
  
    public static void main(String[] args) {
      SpringApplication.run(TimesheetCoreApplication.class, args);
    }
  }
  </code></pre></li>
  </ol>
  
  <p>Along with the following two in my web.war</p>
  
  <pre><code>import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  
  @SpringBootApplication
  public class TimesheetWebApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(TimesheetWebApplication.class, args);
      }
  }
  </code></pre>
  
  <p>AND</p>
  
  <pre><code>import org.springframework.boot.builder.SpringApplicationBuilder;
  import org.springframework.boot.context.web.SpringBootServletInitializer;
  
  public class ServletInitializer extends SpringBootServletInitializer {
  
      @Override
      protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
          return application.sources(TimesheetWebApplication.class);
      }
  
  }
  </code></pre>
  
  <ol start="3">
  <li>Since Spring Boot does a lot of auto configuration, will they step over each other with the configuration, either conflicting or overriding one another?</li>
  </ol>
  
  <p>What is the best way to approach this? I would like to leverage Spring Boot if possible.</p>