springboot pom问题及注解
2024-09-04 15:29:56
springboot pom不需要指定版本号 springboot会自己管理版本号
<!-- 支持热部署 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
注意 : 更改完java代码需要重新编译 ctrl+f9,否则依然没用
@Component 加载到容器中
@ConfigurationProperties(prefix = "person") 加上该注解后,就会注入在application.properties中server开头的属性
@Configuration 加上这个的类代表spring IOC容器
这个相当于bean
@Import 多个配置文件整合在一起中间用逗号隔开
@SpringBootTest 配置文件属性的读取
@RunWith(SpringRunner.class) 当一个类用@RunWith注释或继承一个用@RunWith注释的类时,
JUnit将调用它所引用的类来运行该类中的测试而不是开发者去在junit内部去构建它。我们在开发过程中使用这个特性。
@ConfigurationProperties和@value的区别
@propertySource("classPath:...") 指定读取配置文件
@ImportResource 导入spring配置文件 让配置文件里面的内容生效
最新文章
- Android进阶--Acticivity的启动模式
- vue.js 使用小结
- VS2013无法连接到SqlServer的问题解决
- js冒泡排序
- jiffies溢出与时间先后比较-time_after,time_before【转】
- Windows Services windows域账户管理
- 用友U8按BOM计算销售订单物料需求SQL代码 第一稿
- POJ1328 Radar Installation(贪心)
- 【转】Ubuntu Server 12.04 静态IP简洁配置
- Android ListView 单条刷新方法实践及原理解析
- PHP 7.2 新功能介绍
- 什么是shell和终端?
- 学习Makefile
- Kafka的生产者和消费者代码解析
- arcpy加载mxd文件时,无效的MXD路径,提示assert (os.path.isfile(mxd) or (mxd.lower() == ";current";)), gp.getIDMessage(89004, ";Invalid MXD filename";)
- 实验吧 貌似有点难 伪造ip
- C# 分支语句 练习题(中间变量,随机数)
- ssh-remote-port-forwarding
- Centos7创建用户su登录后显示为 bash-4.1$
- WinSockets编程(六)select模式