If you are doing code in STS you just need to add the devtools dependency in your maven file. After that it will run itself whenever you will do some change.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>