Setup Devtools in Spring boot project in maven and gradle file

Devtools use to auto reflect changes to server, no need to start server after every change in the code.







Maven : 

<dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency> </dependencies>


Gradle :

configurations { developmentOnly runtimeClasspath { extendsFrom developmentOnly } } dependencies { developmentOnly("org.springframework.boot:spring-boot-devtools") }


Disable Devtools property:


public static void main(String[] args) { System.setProperty("spring.devtools.restart.enabled", "false"); SpringApplication.run(MyApp.class, args); }



Post a Comment

Previous Post Next Post