1. 程式人生 > >SpringBoot2.0.4 修改程式碼不用重啟服務

SpringBoot2.0.4 修改程式碼不用重啟服務

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

<build>
	<resources>
		<resource>
			<directory>src/main/resources</directory>
			<filtering>false</filtering>
			<includes>
				<include>**</include>
			</includes>
		</resource>
	</resources>

	<plugins>
		<plugin>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-maven-plugin</artifactId>
			<configuration>
				<fork>true</fork><!--fork :  如果沒有該項配置,那個devtools不會起作用,即應用不會restart -->
				<addResources>true</addResources>
			</configuration>
			<executions>
				<execution>
					<goals>
						<goal>repackage</goal>
					</goals>
				</execution>
			</executions>
		</plugin>
	</plugins>
</build>

Intelij Idea

按下 Ctrl+Shift+Alt+/ 組合鍵