<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>SpringBoot on 知识铺的博客</title>
    <link>https://index.zshipu.com/geek/tags/SpringBoot/</link>
    <description>Recent content in SpringBoot on 知识铺的博客</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>zh-CN</language>
    <lastBuildDate>Wed, 06 Mar 2024 13:34:00 +0000</lastBuildDate>
    <atom:link href="https://index.zshipu.com/geek/tags/SpringBoot/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>SpringBoot-自动装配</title>
      <link>https://index.zshipu.com/geek/post/code/docs/SpringBoot/SpringBoot-%E8%87%AA%E5%8A%A8%E8%A3%85%E9%85%8D/</link>
      <pubDate>Wed, 06 Mar 2024 13:34:00 +0000</pubDate>
      <guid>https://index.zshipu.com/geek/post/code/docs/SpringBoot/SpringBoot-%E8%87%AA%E5%8A%A8%E8%A3%85%E9%85%8D/</guid>
      <description>Spring Boot 自动装配 Author: HuiFer 源码阅读仓库: SourceHot-spring-boot org.springframework.boot.autoconfigure.SpringBootApplication 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented @Inherited @SpringBootConfiguration @EnableAutoConfiguration @ComponentScan(excludeFilters = { @Filter(type = FilterType.CUSTOM, classes = TypeExcludeFilter.class), @Filter(type = FilterType.CUSTOM, classes = AutoConfigurationExcludeFilter.class) }) public @interface SpringBootApplication { @AliasFor(annotation = EnableAutoConfiguration.class) Class&amp;lt;?&amp;gt;[] exclude() default {}; @AliasFor(annotation = EnableAutoConfiguration.class) String[] excludeName() default {}; @AliasFor(annotation = ComponentScan.class, attribute = &amp;#34;basePackages&amp;#34;) String[] scanBasePackages() default {}; @AliasFor(annotation = ComponentScan.class, attribute = &amp;#34;basePackageClasses&amp;#34;) Class&amp;lt;?&amp;gt;[] scanBasePackageClasses() default {}; @AliasFor(annotation = Configuration.class) boolean proxyBeanMethods() default true; } EnableAutoConfiguration 1 2 3 4 5 6 7 8 9 @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented @Inherited @AutoConfigurationPackage @Import(AutoConfigurationImportSelector.class) public @interface EnableAutoConfiguration { } AutoConfigurationImportSelector 类图 getAutoConfigurationMetadata() 1 2 3 4</description>
    </item>
    <item>
      <title>SpringBoot-application-load</title>
      <link>https://index.zshipu.com/geek/post/code/docs/SpringBoot/SpringBoot-application-load/</link>
      <pubDate>Wed, 06 Mar 2024 13:33:00 +0000</pubDate>
      <guid>https://index.zshipu.com/geek/post/code/docs/SpringBoot/SpringBoot-application-load/</guid>
      <description>Spring Boot application 文件加载 Author: HuiFer 源码阅读仓库: SourceHot-spring-boot 如何找到这个加载的过程 创建配置文件application.yml 全局搜索 yml 换成properties搜索 我们以yml为例打上断点开始源码追踪 看到调用堆栈 一步一步回上去看如何调用具体方法的 ConfigFileApplicationListener 配置文件监听器 调用过程 org.springframework.boot.context.config.ConfigFileApplicationListener#addPropertySources 1 2 3 4 5 protected void addPropertySources(ConfigurableEnvironment environment, ResourceLoader resourceLoader) { RandomValuePropertySource.addToEnvironment(environment); // 加载器加</description>
    </item>
    <item>
      <title>SpringBoot-LogSystem</title>
      <link>https://index.zshipu.com/geek/post/code/docs/SpringBoot/SpringBoot-LogSystem/</link>
      <pubDate>Wed, 06 Mar 2024 13:32:00 +0000</pubDate>
      <guid>https://index.zshipu.com/geek/post/code/docs/SpringBoot/SpringBoot-LogSystem/</guid>
      <description>SpringBoot 日志系统 Author: HuiFer 源码阅读仓库: SourceHot-spring-boot 包路径: org.springframework.boot.logging 日志级别 日志级别: org.springframework.boot.logging.LogLevel 1 2 3 public enum LogLevel { TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF } Java 日志实现 org.springframework.boot.logging.java.JavaLoggingSystem 1 2 3 4 5 6 7 8 9 10 static { // KEY : springBoot 定义的日志级别, value: jdk 定义的日志级别 LEVELS.map(LogLevel.TRACE, Level.FINEST); LEVELS.map(LogLevel.DEBUG, Level.FINE); LEVELS.map(LogLevel.INFO, Level.INFO); LEVELS.map(LogLevel.WARN, Level.WARNING); LEVELS.map(LogLevel.ERROR, Level.SEVERE); LEVELS.map(LogLevel.FATAL, Level.SEVERE); LEVELS.map(LogLevel.OFF, Level.OFF); } LEVELS 对象 1 2 3 4 5 6 7 8 9 10 protected static class LogLevels&amp;lt;T&amp;gt; { /** * key ： SpringBoot 中定义的日志级别, value: 其他日志框架的日</description>
    </item>
    <item>
      <title>SpringBoot-ConfigurationProperties</title>
      <link>https://index.zshipu.com/geek/post/code/docs/SpringBoot/SpringBoot-ConfigurationProperties/</link>
      <pubDate>Wed, 06 Mar 2024 13:31:00 +0000</pubDate>
      <guid>https://index.zshipu.com/geek/post/code/docs/SpringBoot/SpringBoot-ConfigurationProperties/</guid>
      <description>SpringBoot ConfigurationProperties Author: HuiFer 源码阅读仓库: SourceHot-spring-boot 本文主要对org.springframework.boot.context.properties.ConfigurationProperties进行分析 ConfigurationProperties 顶部注释 1 2 3 4 * @see ConfigurationPropertiesScan * @see ConstructorBinding * @see ConfigurationPropertiesBindingPostProcessor * @see EnableConfigurationProperties 看到ConfigurationPropertiesScan 去看</description>
    </item>
    <item>
      <title>SpringBoot-ConditionalOnBean</title>
      <link>https://index.zshipu.com/geek/post/code/docs/SpringBoot/SpringBoot-ConditionalOnBean/</link>
      <pubDate>Wed, 06 Mar 2024 13:30:00 +0000</pubDate>
      <guid>https://index.zshipu.com/geek/post/code/docs/SpringBoot/SpringBoot-ConditionalOnBean/</guid>
      <description>SpringBoot ConditionalOnBean Author: HuiFer 源码阅读仓库: SourceHot-spring-boot 在 SpringBoot 中有下列当 XXX 存在或不存的时候执行初始化 ConditionalOnBean ConditionalOnClass ConditionalOnCloudPlatform ConditionalOnExpression ConditionalOnJava ConditionalOnJndi ConditionalOnMissingBean ConditionalOnMissingClass ConditionalOnNotWebApplication ConditionalOnProperty ConditionalOnResource ConditionalOnSingleCandidate ConditionalOnWebApplication ConditionalOnBean 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 @Target({ ElementType.TYPE, ElementType.METHOD }) @Retention(RetentionPolicy.RUNTIME) @Documented @Conditional(OnBeanCondition.class) public @interface ConditionalOnBean { /** * 需要匹配的 bean 类型 */ Class&amp;lt;?&amp;gt;[] value() default {}; /** * 需要匹配的 bean 类型 */ String[] type() default {}; /** * 匹配的 bean 注解 */ Class&amp;lt;? extends Annotation&amp;gt;[] annotation() default {}; /**</description>
    </item>
    <item>
      <title>Spring-Boot-Run</title>
      <link>https://index.zshipu.com/geek/post/code/docs/SpringBoot/Spring-Boot-Run/</link>
      <pubDate>Wed, 06 Mar 2024 13:29:00 +0000</pubDate>
      <guid>https://index.zshipu.com/geek/post/code/docs/SpringBoot/Spring-Boot-Run/</guid>
      <description>SpringBoot 启动方法 Author: HuiFer 源码阅读仓库: SourceHot-spring-boot 入口 通常一个简单的 SpringBoot 基础项目我们会有如下代码 1 2 3 4 5 6 7 8 9 10 @SpringBootApplication @RestController @RequestMapping(&amp;#34;/&amp;#34;) public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } } 值得关注的有SpringApplication.run以及注解@SpringBootApplication run 方法 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20</description>
    </item>
  </channel>
</rss>
