IDEA 解决Springboot Mave热部署问题
1.父 pom 依赖 spring cloud 的 大版本 ,各个子模块 需增加 依赖
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
2.父 pom 的build 标签
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<!--该插件的主要功能是进行项目的打包发布处理-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.4.2.RELEASE</version>
<!--IDEA热启动插件-->
<configuration> <!--设置程序执行的主类-->
<mainClass>com.gwolf.StartSpringBootMain</mainClass>
<fork>true</fork>
<addResources>true</addResources>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
3. File-Settings

Build project automatically
4. ctrl +shift +a 选择Registry
ompiler.automake.allow.when.app.running

5.更改代码 ,或者更改配置文件,是不需要重启IDEA 的。可以生效。
感谢阅读博客,欢迎向博主讨论问题。
浙公网安备 33010602011771号