Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring boot hot deployment for templates and resources under IntelliJ

Is anyone aware of a mechanism to get hot deployment for resources and template working under IntelliJ 14.0.2 for a Spring Boot application.

I know that full Spring Boot support is scheduled for 14.1 but I have a project that I converted over from a standard WAR project to a Spring Boot project and I really miss the hot deployment.

At the moment I have to manually build the project that the resources are in to get hot deployment and even then it is a bit flaky sometimes. I would prefer to just save a template or a javascript/css file and get it picked up as I did when I was running my app using a local tomcat server via IntelliJ.

I could switch back to Eclipse to get this working, but my project is Scala based and IntelliJ Scala support is far superior.

like image 548
thedoctor Avatar asked Jan 13 '15 09:01

thedoctor


People also ask

How do I enable hot deployment in IntelliJ?

Go to the File –> Settings –> Debugger –> HotSwap and ensure that all checkboxes are checked and the radio button “Reload classes after compilation” is set to “Always”. As next step, click on the ” Edit Configurations…” and go to the configured server.

Can I use IntelliJ for Spring Boot?

IntelliJ IDEA creates a Spring Boot run configuration that you can use to run your new Spring application. If the run configuration is selected, press Shift+F10 . icon in the gutter of the SpringBootTutorialApplication. java file next to the class declaration or the main() method declaration.

What is hot deployment in Spring Boot?

So using hot deployment, you can load the modified code without restarting the service after modifying the code, but it can only be used to update the method body. IDEA as an artifact naturally supports this technology.


1 Answers

As instructed here adding spring-boot-devtools dependency will enable static resources reloading (templates and css).

Beware that you need to select Build -> Compile for this to work.

like image 146
sikrip Avatar answered Oct 12 '22 20:10

sikrip