Spring Boot : Command Line Application

You can use https://start.spring.io  to generate the spring boot application as you are already aware.

It is very easy to create a spring boot application that is run on command line. You need to follow only two simple steps.

  1.  implements the CommandLineRunner interface.
  2.  override the run() method

if you have done above two steps, you are done with building the command line application with spring boot. here is the sample code segment.

How to build and run the application?
Build
maven clan install

Run
java -jar target/spring-boot-commandline-application-0.0.1-SNAPSHOT.jar

 

Full source code of this post can be found at GitHub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s