in

GeekyGeeky

How to enable Spring Developer tools in IntelliJ IDEA

enabling Spring Developer tools in IntelliJ IDEA

Spring Developer tools:
Spring Developer tools can make the developer experience pleasant and save time by offering a high-speed feedback loop for code changes. It also provides other development-time features like Property Defaults, LiveReload & Remote updates.

Hot-swapping or Automatic Restart feature automatically restarts the application whenever files (except static assets) on the classpath change to allow the developer to see the changes immediately. Changes to the static assets don’t even need a restart to be visible.

Enabling Spring developer tools is a straightforward process in Eclipse. All you have to do is add the below Spring devtools dependency to your build. But Enabling the same in IntelliJ IDEA requires little configuration changes. So let us learn how to do that.

Enabling Spring Developer tools in IntelliJ IDEA:

Step 1: Add the dependency to your build.

Add the below devtools dependency to your build.

Maven:

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

Gradle:

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

Step 2: Build project automatically

Allow IntelliJ to run the build automatically using the below steps.

Windows: File –> Setting –> Build, Execution, Deployment –> Compiler –> check “Build project automatically.”
Mac : IntelliJ IDEA -> Preferences -> Build, Execution, Deployment –> Compiler –> check “Build project automatically”

Enabling Spring Developer tools in IntelliJ IDEA -build project automatically
Enabling Spring Developer tools in IntelliJ IDEA – Build project automatically.

Step 3: Update registry to allow Automake

Allow auto-make to run (even when the application is currently running) by following the below steps.

  • Press SHIFT+CTRL+A (Win) or Command+SHIFT+A (Mac) to open Actions window and type registry.
Enabling Spring Developer tools in IntelliJ IDEA- registry -1
Enabling Spring Developer tools in IntelliJ IDEA – Update Registry
  • Enable “compiler.automake.allow.when.app.running”
Enabling Spring Developer tools in IntelliJ IDEA- registry-2
Enabling Spring Developer tools in IntelliJ IDEA – Allow Automake

That is all. Intellij IDEA will now restart the application every time a class in the classpath is updated. There won’t be any auto restart if a static file is updated, but changes will be effective without manually restarting the application.

Also read:
Java Key Store (JKS) Complete Guide
What is Pogo Sticking in SEO?
Rich Snippet: What is it & How do you get it
What is a programming paradigm?
e-landing-page-sitemap.xml : Can be read, but has errors

This post was created with our nice and easy submission form. Create your post!

What do you think?

31 Points
Upvote Downvote

Written by Alien Arts

Comments

Leave a Reply

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

GIPHY App Key not set. Please check settings