title: springboot autowiring @Repository inside of @Configuration not working
body: <p>I have a simple spring boot application in which I have a jpa repository object which i want to autowire inside an <code>@Configuration</code> class like below. </p>
  
  <pre><code>@Configuration
  public class Appconfig {
  
      @Bean
      @Autowired
      public  PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer(OctopusPropertiesRepository repo) {
          PropertySourcesPlaceholderConfigurer property = new PropertySourcesPlaceholderConfigurer();
          Map&lt;String,Object&gt; props = new ConcurrentHashMap&lt;&gt;();
          List&lt;OctopusProperties&gt; loadedSettings = repo.findAll();
          loadedSettings.forEach(entry -&gt; props.put(entry.getKey(), entry.getValue()));
          MutablePropertySources mutablePropertySources = new MutablePropertySources();
          mutablePropertySources.addFirst(new MapPropertySource("custom", props));
          property.setPropertySources(mutablePropertySources);
          return property;
      }
  }
  </code></pre>
  
  <p>And here is the <code>@Repository</code> class</p>
  
  <pre><code>@Repository
  public interface OctopusPropertiesRepository extends JpaRepository&lt;OctopusProperties, Long&gt; {
  }
  </code></pre>
  
  <p>And I get following exception.</p>
  
  <pre><code>Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.example.app.OctopusPropertiesRepository]
  </code></pre>
  
  <p>If i don't make that configuration and boot app successfully i see from the actuator that bean is available. What is the problem here? why I can't wire <code>@Repository</code> inside <code>@Configuration</code>.</p>
  
  <p><strong>P.S.</strong> These two java files are under same folder: <code>com.example.app</code></p>
  
  <p><strong>P.P.S.</strong> Eclipse view of my project:</p>
  
  <p><a href="https://i.stack.imgur.com/q2XwV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q2XwV.png" alt="enter image description here"></a></p>