How to do automatic reboot using Spring-boot on IDEA Intellij

I wrote a project base on Spring-boot, tomcat, freemarker, I started it successfully, but whenever I change some templates and the java class, I have to restart the server or use the "reload changed classes" menu in Intellij for the changes to take effect force. He spends a lot of time!

Then I try to use springloaded as the official said :

<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>springloaded</artifactId> <version>1.2.0.RELEASE</version> <scope>system</scope> <systemPath>${project.basedir}/lib/springloaded-1.2.0.RELEASE.jar</systemPath> </dependency> </dependencies> </plugin> 

then I will restart the server, but it does not work as expected! I still need to restart the server after any changes to the template or class.

How can I configure the boot with spring for automatic reboot. Many thanks!


Spring-boot version is 1.3.0RC1

 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.3.0.RC1</version> </parent> 

maven version: 3.2 JDK: 1.8 intellij: 14.1.5 os: windows 8.1 64 bit

+8
java spring spring-boot junit
source share
2 answers

First, make sure you add spring-boot-devtools as a dependency:

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

Secondly, make sure that the option File->Setting –> Build, Execution, Deployment –> Compiler–> Automatically compose the project is checked.

Finally, press SHIFT+CTRL+A for Linux / Windows users or Command+CTRL+A for Mac users, then record the tape and enter the registry in the pop-up window that opens. In the Registry window, check the compiler.automake.allow.when.app.running parameter.

The instructions above are taken from here.

+14
source share

CTRL+F9 make a project with debugging. The idea is to make the project work automatically until it works or is debugged!

Settings-> Build-> Compiler-> check Make project automatically.

0
source share

All Articles