title: Spring-Boot Executable-Jar NoSuchBeanDefinitionException
body: <p>I have an application created using Spring-Boot.</p>
  <pre><code>&lt;parent&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
      &lt;version&gt;1.1.8.RELEASE&lt;/version&gt;
  &lt;/parent&gt;
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
      &lt;/dependency&gt;
  </code></pre>
  <p>And have my Appplication.java annotated as shown below.</p>
  <pre><code>@Configuration
  @EnableAutoConfiguration
  @ComponentScan
  public class Application
  
  public static void main(String[] args) {
      final ConfigurableApplicationContext context = SpringApplication.run(Application.class);
  ...
  </code></pre>
  <p>This works when I run it inside eclipse without any problems but, when I generate an executable jar it throws the exception</p>
  <pre><code>Exception in thread &quot;main&quot; org.springframework.beans.factory.NoSuchBeanDefinitionException: No    qualifying bean of type [com.company.engine.services.BaseDao] is defined
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:319)
      at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:987)
  </code></pre>
  <p>Any ideas?</p>
  <p>pom.xml</p>
  <pre><code>&lt;profiles&gt;
   &lt;profile&gt;
   &lt;id&gt;prod&lt;/id&gt;
   &lt;build&gt;
   &lt;plugins&gt;
    &lt;plugin&gt;
    &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
    &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
    &lt;version&gt;3.1&lt;/version&gt;
    &lt;configuration&gt;
    &lt;source&gt;1.6&lt;/source&gt;
    &lt;target&gt;1.6&lt;/target&gt;
    &lt;/configuration&gt;
   &lt;/plugin&gt;
   &lt;plugin&gt;
    &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
    &lt;executions&gt;
    &lt;execution&gt;
    &lt;phase&gt;install&lt;/phase&gt;
    &lt;goals&gt;
    &lt;goal&gt;copy-dependencies&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;configuration&gt;
    &lt;archive&gt;
    &lt;manifest&gt;
    &lt;mainClass&gt;com.company.engine.Application&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;/plugin&gt;
  &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>
  <p><strong>Project Structure</strong></p>
  <p><strong>com.company.engine</strong></p>
  <p>Application.java</p>
  <p><strong>com.company.engine.model</strong></p>
  <p>Domain.java</p>
  <p><strong>com.company.engine.service</strong></p>
  <p>CrudRepositoryJavaClasses</p>
  <p><strong>Solution from @Oleg Majewski with minor modifications :</strong></p>
  <pre><code>&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;version&gt;1.1.8.RELEASE&lt;/version&gt;
        &lt;configuration&gt;
          &lt;mainClass&gt;com.company.engine.Application&lt;/mainClass&gt;
          &lt;layout&gt;ZIP&lt;/layout&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;/plugins&gt;
  &lt;/build&gt;
  </code></pre>