天天看點

SpringBoot_05_熱部署和debug

一、pom.xml配置

增加以下pom.xml配置

<!--1.spring-boot插件-->
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <fork>true</fork>
                    <jvmArguments>
                        -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
                    </jvmArguments>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>springloaded</artifactId>
                        <version>1.2.6.RELEASE</version>
                    </dependency>
                </dependencies>
            </plugin>      

二、添加一個remote

在工具欄中的Run -> Edit Configurations... -> Remote,

建立一個啟動項,什麼都不用改,但為了友善名字随便起一個你能區分開的就行,

我這裡叫debug了

SpringBoot_05_熱部署和debug

三、以debug方式啟動

1.執行 spring-boot:run

2.以 debug 方式啟動 remote

SpringBoot_05_熱部署和debug
SpringBoot_05_熱部署和debug

二、參考資料

1.

SpringBoot 熱加載以及添加debug調試

繼續閱讀