How to reload Changes on Spring Boot without Server Restart


Situations may occur when you need to speed up your development works without having to worry about restarting the server for every change in the piece of code in your application. Spring Boot provides such provision using which you can easily achieve the goal.

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.

With this dependency any changes you save, the embedded tomcat will restart. Spring Boot has a Developer tools (devtools) module helps to improve the productivity of developers.


Spring Boot 2.2.2 – 2.4.5, Spring Boot Devtools, Java at least 8

Reload Code Changes without Restarting Server

Let’s create Spring Boot project in Eclipse IDE. The name of the project is spring-boot-reload-changes-without-server-restart.

The build.gradle script is given below with the required dependencies for gradle based project:

buildscript {
	ext {
		springBootVersion = '2.2.2.RELEASE' to 2.4.5
    repositories {
    dependencies {

plugins {
    id 'java-library'
    id 'org.springframework.boot' version "${springBootVersion}"

sourceCompatibility = 12
targetCompatibility = 12

repositories {

dependencies {

The corresponding pom.xml file is given below for maven based project:

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns=""







Now I will write main class to start up the Spring Boot application:

package com.roytuts.spring.boot.reload.changes.without.server.restart;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

public class SpringBootChangesWithoutRestartServerApp {

	public static void main(String[] args) {, args);


Now running the above main class will deploy your application and server will be started on port 8080.

Now try to hit the root URL http://localhost:8080 or http://localhost:8080/greet, you will see below output on browser:

reload changes on spring boot without server restart

Next I am creating the following Spring REST controller class with the /greet endpoint.

package com.roytuts.spring.boot.reload.changes.without.server.restart;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

public class GreetingController {

	public String greet() {
		return "Greetings, Welcome!";


Now on every save on your code changes the embedded Tomcat server will be reinitialized automatically.

Now hitting the URL http://localhost:8080/greet will give you the following output:

reload changes on spring boot without server restart

So you got an idea how to reload our code changes in Spring Boot application without restarting the server.

Source Code


1 thought on “How to reload Changes on Spring Boot without Server Restart

Leave a Reply

Your email address will not be published. Required fields are marked *