title: "No auto configuration classes found in META-INF/spring.factories" Trying to build Spring standalone
body: <p>I am trying to build a standalone .jar from a multi-module Maven project. </p>
  
  <p>The project structure is</p>
  
  <p>ema-server/
    shared/   # To share with Java clients
    rest-api/ # Spring REST API
    server/   # Provides the main() for the standalone and bundles all together
    web/      # A simple AngularJS web server</p>
  
  <p>The <code>server/</code> module exists in order to build the <strong>standalone</strong> <code>.jar</code>. To do so it depends on the <code>rest-api/</code> module which contains the <code>@SpringBootApplication</code>. </p>
  
  <p>You can <a href="http://pastebin.com/UxhwVngF" rel="nofollow noreferrer">take a look</a> at my desperate attempts to make this work but this is my current "solution":</p>
  
  <p>The <strong>pom.xml</strong> of the <code>server/</code> module:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
      &lt;configuration&gt;
          &lt;fork&gt;true&lt;/fork&gt;
          &lt;mainClass&gt;org.ema.server.Server&lt;/mainClass&gt;
      &lt;/configuration&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;goals&gt;
                  &lt;goal&gt;repackage&lt;/goal&gt;
              &lt;/goals&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  &lt;plugin&gt;
      &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.2-beta-5&lt;/version&gt;
      &lt;configuration&gt;
          &lt;archive&gt;
              &lt;manifest&gt;
                  &lt;addClasspath&gt;true&lt;/addClasspath&gt;
                  &lt;mainClass&gt;org.ema.server.Server&lt;/mainClass&gt;
              &lt;/manifest&gt;
          &lt;/archive&gt;
          &lt;descriptorRefs&gt;
              &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
          &lt;/descriptorRefs&gt;
      &lt;/configuration&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;id&gt;assemble-all&lt;/id&gt;
              &lt;phase&gt;package&lt;/phase&gt;
              &lt;goals&gt;
                  &lt;goal&gt;single&lt;/goal&gt;
              &lt;/goals&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>I would like to state here that if I run this thing from within Eclipse as a Java Application everything works. </p>
  
  <p>However, if I run the "standalone" <code>java "*" org.ema.server.Server</code> I am getting:</p>
  
  <pre><code>org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [org.ema.server.Server]; nested exception is java.lang.IllegalArgumentException: No auto configuration classes found in META-INF/spring.factories. If you are using a custom packaging, make sure that file is correct.
      at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:488)
      at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:191)
      at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:321)
      at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243)
      at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273)
      at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:98)
      at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:681)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:523)
      at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737)
      at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:314)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151)
      at org.ema.server.Server.main(Server.java:30)
  Caused by: java.lang.IllegalArgumentException: No auto configuration classes found in META-INF/spring.factories. If you are using a custom packaging, make sure that file is correct.
      at org.springframework.util.Assert.notEmpty(Assert.java:276)
      at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector.getCandidateConfigurations(AutoConfigurationImportSelector.java:152)
      at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector.selectImports(AutoConfigurationImportSelector.java:94)
      at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:480)
      ... 14 common frames omitted
  </code></pre>
  
  <p>You can take a look at the complete output <a href="http://pastebin.com/hSxnU7Y6" rel="nofollow noreferrer">here</a>. </p>
  
  <p>Can somebody tell me how I can make this work? </p>
  
  <p>Please let me know if I can provide further information.</p>