springboot:热部署

pom.xml:
==========================================
<!-- 支持热部署 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <fork>true</fork>
                </configuration>
                <dependencies>
                    <!-- spring热部署-->
                    <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>springloaded</artifactId>
                        <version>1.2.7.RELEASE</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>
==========================================
idea14:修改idea Compiler 勾选 make project automatically

高版本:
1、setting -> Compile -> Build project automatically --> 选中
2、COMMAND + SHIFT + ALT + / --> 查找Registry --> 找到并勾选compiler.automake.allow.when.app.running
==========================================
方式1:
在terminal中执行命令 mvn spring-boot:run
==========================================
方式2:
修改完类之后 Build---compile 'xxx.java'

猜你喜欢

转载自samson870830.iteye.com/blog/2382849