title: generating a working war file with maven for a spring-boot web application
body: <p>We have a maven-managed spring-boot application that we now need to deploy in tomcat using a WAR file. During development, we used maven to start an embedded tomcat with the command:</p>
  
  <pre><code>mvn -D"-classpath %classpath package.path.App" -D"exec.executable=java" process-classes org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
  </code></pre>
  
  <p>I can build a war file by running <code>mvn war:war</code>, but if I try to deploy the resulting war, an error is produced:</p>
  
  <pre><code>SEVERE: ContainerBase.addChild: start: 
  org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext
  ...
  Caused by: java.lang.IllegalStateException: No SpringApplication sources have been defined. Either override the configure method or add an @Configuration annotation
  </code></pre>
  
  <p>I tried adding a <code>mainClass</code> directive to the <code>maven-war-plugin</code>'s configuration, but to no avail.</p>