title: NoSuchBeanDefinitionException being thrown
body: <p>So I am trying to use a bean generated in another class to be used in the main application</p>
  
  <pre class="lang-java prettyprint-override"><code>    package com.simon.spring.basics.properties;
  
      import org.springframework.beans.factory.annotation.Qualifier;
      import org.springframework.beans.factory.annotation.Value;
  
      import org.springframework.stereotype.Component;
  
      @Component
      public class SomeExternalService {
  
          @Value("${external.service.url}")
  
          private String url;
  
          public String returnServiceURL(){
              return url;
          }
      }
  </code></pre>
  
  <p>And the main application is here:</p>
  
  <pre class="lang-java prettyprint-override"><code>    package com.simon.spring.basics.springin5steps;
  
      import com.simon.spring.basics.properties.SomeExternalService;
      import org.springframework.boot.SpringApplication;
      import org.springframework.boot.autoconfigure.SpringBootApplication;
      import org.springframework.context.ApplicationContext;
      import org.springframework.context.annotation.ComponentScan;
      import org.springframework.context.annotation.Configuration;
      import org.springframework.context.annotation.PropertySource;
  
  @Configuration
      @SpringBootApplication
      //@PropertySource("classpath:application.properties")
      @ComponentScan()
      public class SpringIn5StepsPropertiesApplication {
  
          public static void main(String[] args) {
  
              ApplicationContext applicationContext =
                      SpringApplication.run(SpringIn5StepsPropertiesApplication.class, args);
              SomeExternalService service = applicationContext.getBean(SomeExternalService.class);
              System.out.println(service);
  
      }
  
  
  }
  </code></pre>
  
  <p>So basically a Exception in thread "main" org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.simon.spring.basics.properties.SomeExternalService' available is being thrown.
  What Can I do to fix this error and to avoid the same problems later on</p>