sprinboot 热加载

Java框架

浏览数:113

2019-8-22

AD:资源代下载服务

1/配置idea

深度截图_选择区域_20181107152235.png
深度截图_选择区域_20181107154446.png
深度截图_选择区域_20181107154411.png

2/pom依赖

        <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <dependencies>
                    <!-- spring热部署-->
                    <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>springloaded</artifactId>
                        <version>1.2.7.RELEASE</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <!--fork :  如果没有该项配置,肯定devtools不会起作用,即应用不会restart -->
                    <fork>true</fork>
                    <mainClass>com.huazhu.portal.AlphaPortalApplication</mainClass>
                    <jvmArguments>-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005</jvmArguments>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>springloaded</artifactId>
            <version>1.2.7.RELEASE</version>
        </dependency>

创建一个remote


深度截图_选择区域_20181107154856.png

运行springboot run


深度截图_选择区域_20181107155040.png

出现下面的画面后运行remote


深度截图_选择区域_20181107155126.png
深度截图_选择区域_20181107155321.png

作者:蓝色_fea0