简体   繁体   中英

Propagate code changes by Spring Boot & Vaadin without restart the application in eclipse

Currently, when the Java classes are changed, then the Spring-Boot Application has to be restarted again and again. This is very time-consuming and slows down the development.

So, I'm looking for a way to immediately propagate the changes to the classes without restarting the application.

Something like JRebel.

Yes, that is possible, with DCEVM class hotswapper agent: https://dcevm.github.io/

Installation: 1) download jar from the page given above.

2) run jar with command: java -jar DCEVM-8u144-installer.jar

click "Install DCEVM as altjvm" (If multiple JVMs are displayed here, then select the one that is used by application start).

3) Download Hotswap Agent: https://github.com/HotswapProjects/HotswapAgent/releases JAR and put this somewhere, eg in the JDK directory.

4) In eclipse> Run> Run Configurations> Java Application> YourApp:

Add to "VM Arguments"

-XXaltjvm=dcevm -javaagent:c:\\env\\jdk-1.8u151\\hotswap-agent-1.1.0-SNAPSHOT.jar=autoHotswap=true

(change c:\\env\\jdk-1.8u151\\hotswap-agent-1.1.0-SNAPSHOT.jar with your path)

FINISH

By application start you can see in console something like this:

HOTSWAP AGENT: 20:50:07.106 INFO (org.hotswap.agent.HotswapAgent) - Loading Hotswap agent {1.1.0-SNAPSHOT} - unlimited runtime class redefinition.

Spring Boot documentation, there's a whole section on the topic . You can try Devtools and if it is sufficient stick with that. However, as the documentation states, it might be enough and you may look into Spring Loaded or JRebel instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM