合集-SpringBoot

摘要:Reference Developing with Spring Boot Build Systems SpringBoot官方提供的starter的列表。 Structuring Your Code 避免使用的默认包。 应用的入口类,推荐放置在顶层包下。 Configuration Classes 阅读全文
posted @ 2024-08-18 15:39 jackieathome 阅读(35) 评论(0) 推荐(0) 编辑
摘要:Overview Documentation Requirements Spring Boot 3.3.2需要配套Java 17及以上的版本使用。 Installing Upgrading 对于使用1.X版本的项目,升级至当前的2.X及3.X版本时,需要详细阅读迁移指导。 升级SpringBoot版 阅读全文
posted @ 2024-08-18 11:58 jackieathome 阅读(42) 评论(0) 推荐(0) 编辑
摘要:入行的时候,构建项目的工具为Ant,后来在新项目中引入了Maven。 Ant类似于C语言,构建过程的每个环节,都需要详细指定,虽然功能很强大,但是写构建脚本的过程,开发体验和维护体验比较差。 Maven类似于C++语言,基于项目模型、约定大于配置等理念,重新定义了构建过程,分离框架和插件的交互和职责 阅读全文
posted @ 2024-08-18 00:02 jackieathome 阅读(35) 评论(0) 推荐(0) 编辑
摘要:Reference Core Features SpringApplication 使用SpringBoot开发应用,最简单的启动类,代码内容如下: import org.springframework.boot.SpringApplication; import org.springframewo 阅读全文
posted @ 2024-08-18 17:00 jackieathome 阅读(49) 评论(0) 推荐(0) 编辑
摘要:Reference Core Features Externalized Configuration SpringBoot应用可以从properties文件、yaml文件、环境变量、命令行参数中得到配置参数。 代码里可以使用注解@Value读取配置项的值。 配置项参数的加载顺序,后加载的属性,可以覆 阅读全文
posted @ 2024-08-18 22:59 jackieathome 阅读(56) 评论(0) 推荐(0) 编辑
摘要:Reference Core Features Profiles 类似Maven的Profile特性,限定配置项取值的生效场景。 在代码中,对于使用注解@Component、@Configuration、@ConfigurationProperties标记的类,可以增加@Profile,限定前述类的 阅读全文
posted @ 2024-08-19 23:11 jackieathome 阅读(18) 评论(0) 推荐(0) 编辑
摘要:Packaging Spring Boot Applications Efficient Deployments Efficient Deployments 默认情况下,基于SpringBoot框架开发应用时,构建插件spring-boot-maven-plugin将项目打包为fat jar。 执行 阅读全文
posted @ 2024-08-24 14:59 jackieathome 阅读(40) 评论(0) 推荐(0) 编辑
摘要:Testing SpringBoot提供了组件spring-boot-test供开发者集成。 Test Scope Dependencies 组件spring-boot-test导入了对如下测试工具的依赖。 JUnit 5: The de-facto standard for unit testin 阅读全文
posted @ 2024-08-24 15:19 jackieathome 阅读(6) 评论(0) 推荐(0) 编辑
摘要:Messaging JMS JMS 关键类,如下: jakarta.jms.ConnectionFactory jakarta.jms.Connection JmsTemplate ActiveMQProperties ActiveMQConnectionFactoryCustomizer JmsL 阅读全文
posted @ 2024-08-24 20:17 jackieathome 阅读(9) 评论(0) 推荐(0) 编辑
摘要:IO Caching Caching SpringBoot提供组件spring-boot-starter-cache,提供缓存能力。 关键类,如下: CacheManager CacheResolver CacheManagerCustomizer ConcurrentMapCacheManager 阅读全文
posted @ 2024-08-24 21:02 jackieathome 阅读(9) 评论(0) 推荐(0) 编辑
摘要:Data Databases SQL Databases SpringBoot提供组件: spring-boot-starter-data-jpa spring-boot-starter-jdbc spring-boot-starter-data-jdbc 关键类,如下: JdbcClient Jd 阅读全文
posted @ 2024-08-24 21:34 jackieathome 阅读(7) 评论(0) 推荐(0) 编辑
摘要:Web 基于SpringBoot框架开发应用,支持内嵌Tomcat/Jetty/Undertow/Netty来提供HTTP服务器。 SpringBoot当前封装了如下组件: spring-boot-starter-web spring-boot-starter-webflux Servlet Web 阅读全文
posted @ 2024-08-25 10:36 jackieathome 阅读(65) 评论(0) 推荐(0) 编辑
摘要:市面上常见的日志记录框架,如下: Logback Log4j2 Log4j 1.X 官方维护已停止,基本上只有老旧项目在使用。 JUL Commons Logging SLF4J 新项目启动时,通常集成SLF4J和Log4j2,代码中使用SLF4J的日志API来记录日志,使用Log4j2来管理日志的 阅读全文
posted @ 2024-08-25 11:00 jackieathome 阅读(7) 评论(0) 推荐(0) 编辑
摘要:The Executable Jar Format 使用spring-boot-maven-plugin构建项目时,生成的目标jar文件的格式的说明。 Nested JARs 以JarLauncher为例: META-INF/MANIFEST.MF,定义jar的元数据。 org.springfram 阅读全文
posted @ 2024-08-25 11:27 jackieathome 阅读(13) 评论(0) 推荐(0) 编辑
摘要:Configuration Metadata 现代的IDE通过解析配置项的元数据信息,从而可以为开发者提供提示信息和补齐能力,提高维护配置文件的效率。 SpringBoot支持的配置文件,比如application.properties或者application.yaml。 对于一般的开发者而言,只 阅读全文
posted @ 2024-08-25 11:38 jackieathome 阅读(11) 评论(0) 推荐(0) 编辑
摘要:Dependency Versions 维护开源软件清单,并不是一个轻松、愉快的工作。 很好奇SpringBoot的开发团队使用什么方式来管理、维护依赖清单,完成兼容性验证工作等。 Managed Dependency Coordinates SpringBoot集成的开源软件的清单,以及版本号。 阅读全文
posted @ 2024-08-25 11:44 jackieathome 阅读(9) 评论(0) 推荐(0) 编辑
摘要:Reference Core Features JSON 支持Gson、Jackson、JSON-B。 SpringBoot提供了组件spring-boot-starter-json。 注解,如下: @JsonComponent @JsonMixin 重要的类,如下: JsonSerializer 阅读全文
posted @ 2024-08-25 15:12 jackieathome 阅读(9) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示