title: Spring console application configured using annotations
body: <p>I want to create spring console application (running from command line with maven for example: mvn exec:java -Dexec.mainClass="package.MainClass").</p>
  
  <p>Is this application I want to have some kind of services and dao layers. I know how to do it for a web application but I have not found any information on how to do in case of a console application (leter maybe with Swing).</p>
  
  <p>I'm trying to create something like:</p>
  
  <pre><code>public interface SampleService {
   public String getHelloWorld();
  }
  
  
  @Service
  public class SampleServiceImpl implements SampleService {
   public String getHelloWorld() {
    return "HelloWorld from Service!";
   }
  }
  
  public class Main {
   @Autowired
   SampleService sampleService;
   public static void main(String [] args) {
    Main main = new Main();
    main.sampleService.getHelloWorld();
   }
  }
  </code></pre>
  
  <p>Is it possible?
  Can I find somewhere an example of how to do it?</p>