0 votes
449 views
in Spring Boot by
How can you enable auto reload of application with Spring Boot?

2 Answers

0 votes
by (4.7k points)
In Spring boot to enable auto reload of application, you have to add the following mapping in your pom.xml configuration file:-

<!-- Spring Boot DevTools for the developer friendly options like Auto Restart of the server -->
<dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-devtools</artifactId>
</dependency>

This mapping will Auto Restart the server.
0 votes
by (4.7k points)

If you want to enable auto reload of application with Spring Boot follows the following steps:-

Step1:- Add the following code in pom.xml maven dependency

<dependency>
 <groupId>org.springframework</groupId>
 <artifactId>springloaded</artifactId>
 <version>1.2.6.RELEASE</version>
</dependency>

Step2:- Automatic restart
Applications that use spring-boot-devtools will automatically restart whenever files on the classpath change. This can be a useful feature when working in an IDE as it gives a very fast feedback loop for code changes. By default, any entry on the classpath that points to a folder will be monitored for changes.

Add the following code in your pom.xml file

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

With DevTools dependency any changes you save, the embedded tomcat will restart. Spring Boot has a Developer tools (DevTools) module which helps to improve the productivity of developers. One of the key challenge for the Java developers is to auto deploy the file changes to server and auto restart the server. 

Share:- Whatsapp Facebook Facebook


Welcome to Developerhelpway Q&A, where you can ask questions and receive answers from other members of the community.

Categories

...