1、SpringBoot工程热部署

  目的是避免开发时修改了源码还要重新启动的麻烦

  解决方案:在pom.xml文件中添加热部署配置

<!--springboot热部署,避免重启服务器-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
        </dependency>

  IDEA需要设置

 

勾选Build project automatically  然后关闭

 

按shift+Ctrl+Alt+/

 

 

2、springboot自动配置功能 

  @SpringBootApplication注解里有多个注解{
    1、@SpringBootApplication
    1.1、@SpringBootConfiguration{
        1.1.1@Configuration{表名这是一个配置类}
    }

    
1.2@ComponentScan{
          1.2.1@Repeatable(ComponentScans.class){约定@ComponentScan所在的包及汽车子包下的类都能扫描}
     }

    1.3@EnableAutoConfiguration{自动配置主要原因
            1.3.1@Import({AutoConfigurationImportSelector.class})

    }
 

  }

 

posted on 2020-08-04 22:40  ¥简竹¥  阅读(181)  评论(0编辑  收藏  举报