Spring Boot Application CommandLineRunner

Sometimes, it is useful to run a command after the Spring Application starts. This can be achieved by implementing the CommandLineRunner and overriding the run method. An example is below.

public class ExampleCLRApplication implements CommandLineRunner {
  public static void main(String[] args) {
    SpringApplication.run(OrgServiceAdapterApplication.class, args);

  public void run(String... args) throws Exception {

Comments |0|

Legend *) Required fields are marked
**) You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
In category: Uncategorized
Tagged with: , , , ,