springcloud学习第三节(热部署)

前言

热部署:就是当你修改了代码之后,你不需要手动重启,他会自动重启业务。
注意:我的代码都是简历在微服务的基础上,所以我的pom文件里面没有version,如果不是微服务框架,记得添加version版本号。

开始吧!

  1. Adding devtools to your project (添加jar包)
子pom
<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
  1. Adding plugin to your pom.xml(添加插件)
父pom
<build>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <configuration>
          <fork>true</fork>
          <addResources>true</addResources>
        </configuration>
      </plugin>
    </plugins>
  </build>
  1. Enabling automatic build(开启自动build)
    在这里插入图片描述
  2. Update the value of(更新)
    快捷键方式打开:shift+Ctrl+alt+/
    在这里插入图片描述
    在这里插入图片描述
    我的因为勾选过了,所以在最上面,你们的没有勾选的在下面自己找就行。

最后一步:重启IDEA。

OK!这一节内容很少。就只有热部署。我们下一节再见。

猜你喜欢

转载自blog.csdn.net/hyfsbxg/article/details/122453832
今日推荐