简体   繁体   English

通过Spring Boot和Vaadin传播代码更​​改,而无需在Eclipse中重新启动应用程序

[英]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. 当前,当更改Java类时,必须重新启动Spring-Boot Application。 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. 类似于JRebel。

Yes, that is possible, with DCEVM class hotswapper agent: https://dcevm.github.io/ 是的,使用DCEVM类热交换代理可以实现: https ://dcevm.github.io/

Installation: 1) download jar from the page given above. 安装:1)从上面给出的页面下载jar。

2) run jar with command: java -jar DCEVM-8u144-installer.jar 2)使用以下命令运行jar: 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). 单击“将DCEVM作为altjvm安装”(如果此处显示多个JVM,则选择应用程序启动使用的JVM)。

3) Download Hotswap Agent: https://github.com/HotswapProjects/HotswapAgent/releases JAR and put this somewhere, eg in the JDK directory. 3)下载Hotswap代理: https : //github.com/HotswapProjects/HotswapAgent/发布 JAR,并将其放在某个位置,例如,在JDK目录中。

4) In eclipse> Run> Run Configurations> Java Application> YourApp: 4)在eclipse>运行>运行配置> Java应用程序> YourApp中:

Add to "VM Arguments" 添加到“ VM参数”

-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) (用您的路径更改c:\\ env \\ jdk-1.8u151 \\ hotswap-agent-1.1.0-SNAPSHOT.jar)

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 . Spring Boot文档中有一个完整的主题 You can try Devtools and if it is sufficient stick with that. 您可以尝试使用Devtools,如果足够的话,可以坚持使用。 However, as the documentation states, it might be enough and you may look into Spring Loaded or JRebel instead. 但是,如文档所述,这可能就足够了,您可以改为使用Spring Loaded或JRebel。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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