Spring Boot Project Hot deployment
One, reference document: Springboot Hot Deployment
Note
2.Digital Twin 项目使用Spring boot 版本为:1.2.3.RELEASE,使用spring-boot-devtools无效. 查看Spring-boot-devtools,最低版本为1.3.0. 猜测Spring boot 整合Spring-boot-devtools最低版本为1.3.03.把SpringLoaded放入spring-boot-maven-plugin中,会导致端口占用,需要用控制面板关闭java程序,所有不推荐
Two. 3 Ways to use
1. Use springloaded to put in Spring-boot-maven-plugin (Port will be occupied, not recommended)
Adding dependencies in pom files
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>springloaded</artifactId> <version>1.2.6.RELEASE</version> </dependency> </dependencies> </plugin> </plugins></build>
2.spring-boot-devtools (Springboot version 1.3.0 above, recommended)
Add Pom file Dependency
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> <!-- 这个需要为 true 热部署才有效 --></dependency>
If we want to specify that Devtools listen to the specified folder, you can configure it in APPLICATION.YML
Spring.devtools.restart.additional-paths=your Path
3. Using springloaded, download springloaded common version (e.g. Springloaded-1.2.3.release.jar) into the specified path (recommended)
启动项目:Application文件-->run as--> Run configurations...-->Arguments-->VM arguments -javaagent:D:/javasoft/springloaded-1.2.3.RELEASE.jar -noverify
Eclipse Spring Boot Project Hot deployment