SpringBoot热部署

来源:互联网 发布:火龙果软件 杨秀峰 编辑:程序博客网 时间:2024/06/04 18:00

首先引入依赖:

<plugin>        <groupId>org.springframework.boot</groupId>        <artifactId>spring-boot-maven-plugin </artifactId>                    <dependencies>                         <!--springloaded  hot deploy -->                         <dependency>                             <groupId>org.springframework</groupId>                             <artifactId>springloaded</artifactId>                             <version>1.2.4.RELEASE</version>                       </dependency>                      </dependencies>                      <executions>                         <execution>                             <goals>                                 <goal>repackage</goal>                             </goals>                             <configuration>                                 <classifier>exec</classifier>                             </configuration>                         </execution>                      </executions></plugin>

运行方法:
1.使用spring-boot:run
2.把spring-loader-1.2.4.RELEASE.jar下载下来,放到项目的lib目录中,然后把IDEA的run参数里VM参数设置为:
-javaagent:.\lib\springloaded-1.2.4.RELEASE.jar -noverify
然后启动就可以了,这样在run as的时候,也能进行热部署

原创粉丝点击