「SpringBoot」devtools 热部署配置

<dependencies>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-devtools</artifactId>
		<scope>runtime</scope>
		<optional>true</optional>
	</dependency>
</dependencies>

<build>
	<plugins>
		<plugin>
			<groupId>org.springframework.boot</groupId>
                	<artifactId>spring-boot-maven-plugin</artifactId>
                	<version>2.0.1.RELEASE</version>
                	<configuration>
                    		<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
                    		<mainClass>com.demongao.coupon.App</mainClass>
                	</configuration>
                	<executions>
                    		<execution>
                        		<goals>
                            			<goal>repackage</goal>
                        		</goals>
                    		</execution>
                	</executions>
        	</plugin>
	</plugins>
</build

必须要配置fork = true, 否则devtools不会生效

Copyright: 采用 知识共享署名4.0 国际许可协议进行许可

Links: https://demongao.com/2020/03/springbootdevtools热部署配置

Buy me a cup of coffee ☕.