1. pom.xml 文件:加入以来,使用maven的方式进行启动,spring-boot:run
<build>
<plugins>
<!-- spring热部署 运行方式:mvn spring-boot:run -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
<version>1.2.8.RELEASE</version>
</dependency>
</dependencies>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<classifier>exec</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
这种方式的运行,停止的时候不会关闭进程,要进行手工的关闭java的进程
2. 使用Java运行参数的方式运行
-javaagent:.\lib\springloaded-1.2.8.RELEASE.jar -noverify
3. 使用spring-boot-devtools 工具进行热部署
3.1 pom.xml 添加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
3.2 启动方式:run as java application
可以加载到新的方法,可以加载到新的类