I'm using spring boot devtools with my project. When i write
System.out.println("test");
before main, it printing twice in console.
public static void main(String[] args) {
System.out.println("test");
SpringApplication.run(TestApplication.class, args);
}
When i remove
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
in pom.xml file,it printing once
Not only twice, if the spring context need to be refreshed, it will run once more.
I believe it is a designed behavior.
The devtools auto-refresh the context instead of restarting manually.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With