If I am developing a rather simple Spring Boot console-based application, I am unsure about the placement of the main execution code. Should I place it in the
You should have a standard loader:
@SpringBootApplication
public class MyDemoApplication {
public static void main(String[] args) {
SpringApplication.run(MyDemoApplication.class, args);
}
}
and implement a CommandLineRunner
interface with @Component
annotation
@Component
public class MyRunner implements CommandLineRunner {
@Override
public void run(String... args) throws Exception {
}
}
@EnableAutoConfiguration
will do the usual SpringBoot magic.
UPDATE:
As @jeton suggests the laters Springboot implements a straight:
spring.main.web-environment=false
spring.main.banner-mode=off
See docs at 72.2