title: Maven Module with Spring Boot
body: <p>I am trying to configure Maven to use Spring Boot with multi modules, this is my structure:</p>
  
  <pre><code>- Parent
  ------ WebClient
  ------------ scr/main/java/config ---&gt; Config Files
  ------------ scr/main/java/resources/WEB-INF ---&gt; Template Files
  ------ Core
  ------ Services
  ------ Server
  </code></pre>
  
  <p>I have a config file where I put my ViewResolver:</p>
  
  <pre><code>@Configuration
  @EnableWebMvc
  public class MvcConfiguration extends WebMvcConfigurerAdapter  {
  
  @Bean
  public ViewResolver setupViewResolver() {
      // View Resolver
      UrlBasedViewResolver viewResolver = new UrlBasedViewResolver();
      viewResolver.setPrefix("/WEB-INF/");
      viewResolver.setSuffix(".jsp");
      viewResolver.setViewClass(JstlView.class);
      return viewResolver;
  }
  </code></pre>
  
  <p>Here is my parent pom.xml modules and dependencies:</p>
  
  <pre><code>&lt;modules&gt;
      &lt;module&gt;core&lt;/module&gt;
      &lt;module&gt;services&lt;/module&gt;
      &lt;module&gt;server&lt;/module&gt;
      &lt;module&gt;webclient&lt;/module&gt;
  &lt;/modules&gt;
  
  
  &lt;dependencyManagement&gt;
      &lt;dependencies&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;version&gt;1.3.3.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.ws&lt;/groupId&gt;
              &lt;artifactId&gt;spring-ws-core&lt;/artifactId&gt;
              &lt;version&gt;2.2.4.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.session&lt;/groupId&gt;
              &lt;artifactId&gt;spring-session&lt;/artifactId&gt;
              &lt;version&gt;1.1.0.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Spring Security and MVC dependences --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-web&lt;/artifactId&gt;
              &lt;version&gt;4.1.0.RC1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-config&lt;/artifactId&gt;
              &lt;version&gt;4.1.0.RC1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
              &lt;version&gt;3.1.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet.jsp&lt;/groupId&gt;
              &lt;artifactId&gt;javax.servlet.jsp-api&lt;/artifactId&gt;
              &lt;version&gt;2.3.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;jstl&lt;/artifactId&gt;
              &lt;version&gt;1.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.tomcat.embed&lt;/groupId&gt;
              &lt;artifactId&gt;tomcat-embed-jasper&lt;/artifactId&gt;
              &lt;version&gt;8.5.0&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
  &lt;/dependencyManagement&gt;
  </code></pre>
  
  <p>At my Server's POM file I have this dependencies:</p>
  
  <pre><code>&lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;mygroup&lt;/groupId&gt;
          &lt;artifactId&gt;core&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;mygroup&lt;/groupId&gt;
          &lt;artifactId&gt;services&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;mygroup&lt;/groupId&gt;
          &lt;artifactId&gt;webclient&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.session&lt;/groupId&gt;
          &lt;artifactId&gt;spring-session&lt;/artifactId&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p></p>
  
  <p>My SpringBootApplication looks like this:</p>
  
  <pre><code>@SpringBootApplication
  @ComponentScan({"config"})
  public class ServerRunner {
  
      public static void main(String [] args) {
          SpringApplication.run(ServerRunner.class, args);
      }
  }
  </code></pre>
  
  <p>When I start my application, I see my mapping working and it seems that everything works well but the problem is that Spring does not find my templates:</p>
  
  <pre><code>Whitelabel Error Page
  This application has no explicit mapping for /error, so you are seeing this as a fallback.
  There was an unexpected error (type=Not Found, status=404).
  /WEB-INF/index.jsp
  </code></pre>
  
  <p>What is wrong with my config? Where should I put my template files?
  Thanks for your help!</p>
  
  <p><strong>EDITED:</strong></p>
  
  <p>If I put my template files at Server Project (server\src\main\webapp) it works! So... How do I make the server to read webclient project templates? I need the templates in that submodule.</p>
  
  <p><strong>EDITED 2:</strong>
  Solved avoid "jsp" files, see answer and comments</p>