前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >springboot知识点补充(一)

springboot知识点补充(一)

作者头像
老梁
发布2019-09-10 16:59:24
3140
发布2019-09-10 16:59:24
举报

测试配置

@RunWith(SpringRunner.class)
@SpringBootTest
@Configuration
@ActiveProfiles("test")
public class ApplicationTests {
    @Test
    public void test() {

    }
}
  • 测试类集成此类就可以实现读取测试的配置文件application-test.properties
  • 在application.properties中配置spring.profiles.active=dev,就可以读取application-dev.properties配置文件信息,在application.properties中可以写一些公共配置,dev中写特殊配置

idea热加载工具devtools工具生效

  1. 首先加pom
<!-- SpringBoot自带热加载开发工具 -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <scope>runtime</scope>
</dependency>
  1. 在idea选项Compiler中把Build project automatically打钩
  2. 再快捷键shift+command+alt+/ 再选择registry,把compiler.automake.allow.when.app.running勾上
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018-11-05 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 测试配置
  • idea热加载工具devtools工具生效
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档