auto-start spring boot appliation
JavaSpring Boot

How to Auto Start Spring Boot application after code changes in IntelliJ Idea

While developing the spring boot applications, developers often have to restart the application repeatedly after every code change to test it. The ‘‘build automatically and start’’ is an excellent way to let your code changes take effect immediately without manually starting the application. Let’s understand how you can Auto Start Spring Boot application in the IntelliJ Idea IDE.

Watch the YouTube video here:

First, add the following dependency in your spring boot application. If you are using maven, you can do it in the pom.xml file as shown below:

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

The next step is to change the settings in the IDE. For that, you can follow the following steps:

  1. Go to preferences in IntelliJ.
  2. Select the ‘Build, Execution, Deployment’ option in the left panel.
  3. Go to the ‘Compiler’ option.
  4. Check the ‘Build project automatically’ option.

The last step we need to do is to enable the auto start even if the application is running.

  1. go to the ‘Advanced Settings’ option which should be the second last option in the left panel.
  2. Check the ‘Allow auto-make to start even if developed application is currently running’.
  3. Click Apply and Ok.

And you are done.

To verify, you can start the application and then make any change in the code, for example, adding a System.out.println statement, and press ctrl + s to save it.

You can see in the IntelliJ Idea console that the application is reloading automatically and the changes you have done will be effective.

In the last post we had discussed about Top 15 Commands You Need to Know. You can read that post here.

Social Media Share

Thanks for reading.

Subscribe to the BitsToGigs Newsletter

What's your reaction?

Excited
0
Happy
0
In Love
0
Not Sure
0
Silly
0

You may also like

More in:Java

Leave a reply

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