title: Spring Boot Component Scan
body: <p>I am writing a new spring boot project where my root package name is <strong>"com.example"</strong>. In my gradle configuration, I am adding a dependency of a third party library, which has root package name as <strong>"org.base"</strong>. Now, this library has classes with @Component annotation which I want to use in my code leveraging @Autowired</p>
  
  <p>In my Config class I am scanning base package of third party library as well.</p>
  
  <pre><code>@Configuration
  @ComponentScan({"org.base", "com.example"})
  public class ServiceConfig{...}
  </code></pre>
  
  <p>When I run the application, spring is not able to find/create beans from this library and I am getting a bean not found error.</p>
  
  <p>For Component Scan to work, does the root package have to be same?</p>
  
  <p>Error Details: UserService required a bean of type 'org.base.util.CommonUtils' that could not be found. </p>
  
  <p>UserService is my service</p>