zoukankan      html  css  js  c++  java
  • Spring Boot源码中模块详解

    Spring Boot源码中模块详解

    一、源码

    spring boot2.1版本源码地址:https://github.com/spring-projects/spring-boot/tree/2.1.x

    二、模块

    Spring Boot 包含许多模块,以下是一些简单的概述:

    1,spring-boot

    为Spring Boot其他部分功能提供主要的lib包,其中包含:
    (1)SpringApplication类提供了静态便利的方法使编写独立的SpringApplication更加容易.它唯一的任务就是创建和刷新一个适当的Spring ApplicationContext.
    (2)为嵌入式web应用选择一个容器(Tomcat、Jetty或者Undertow)
    (3)对外部化配置的支持超级好
    (4)ApplicationContext初始化很方便,包含默认支持合理的日志记录

    2,spring-boot-autoconfigure

    Spring Boot可以在classpath中配置大部分公共应该程序.仅仅一个@EnableAutoConfiguration注释就能触发Spring上下文的自动配置.
    自动配置尝试推断哪些用户需要哪些bean.例如,如果HSQLDB在classpath中配置,并且用户没有配置任何的数据库连接,然而他们可能想定义一个内存数据库.
    当用户开始自定义自己beans时,自动配置将始终退出.

    3,spring-boot-starters

    Starters是一组方便的依赖描述符,可以包含在你的应用程序中.
    你可以为所有Spring和相关技术提供一站式服务,而无需搜索示例代码并复制大量的依赖描述符.
    例如,如果你想开始使用Spring和JPA访问数据库,只需要在你的项目中包含spring-boot-starter-data-jpa依赖项,然后你就可以继续.

    4,spring-boot-cli

    spring命令行应用程序编译并运行Groovy源代码,使编写代码变的非常容易,从而使应用程序能够运行.
    Spring CLI还可以监听文件,在文件更新时候自动编译和重启启动.

    5,spring-boot-actuator

    actuator endpoints允许你监视应用程序并且与其进行交互.
    spring boot actuator提供了actuator endpoints所需的基础设施.
    它包含对actuator endpoints的注释支持.
    这个模块提供了许多端点,包括HealthEndpoint、EnvironmentEndpoint、BeanEndpoint等等.

    6,spring-boot-actuator-autoconfigure

    这个模块为actuator endpoints提供了基于classpath内容和一组属性的自动配置.
    例如,如果Micrometer是在classpath中,它将自动配置MtricsEndpoing.它包含通过HTTP或JMX配置expose endpoints.
    就像Spring Boot AutoConfigure一样,当用户开始自定义自己的beans时,它将退出.

    7,spring-boot-test

    这个模块包含核心项和注释,在测试应用程序的时候可能会有所帮助.

    8,spring-boot-test-autoconfigure

    像Spring Boot AutoConfigure模块,spring-boot-test-autoconfigure在classpath中为tests提供自动配置.
    它包括许多注释,这些注释可以被用于自动配置需要测试的应用程序的一个片段.

    9,spring-boot-loader

    Spring Boot Loader提供秘密武器,允许你构建一个可以使用java-jar启动的jar文件.
    通常情况下你不需要直接使用spring-boot-laoder,而是使用Gradle或者Maven 插件.

    10,spring-boot-devtools

    spring-boot-devtools模块提供开发时特性,例如自动重新启动,对于更流畅的应用开发经验.
    在运行完整打包的应用时,将自动禁用开发工具.

  • 相关阅读:
    修辞方法文章结构
    小学弟的随机字母
    kindeditor在JSP中的使用
    没有规矩,不成方圆
    在博客园安家啦
    Windows下,mysqlcc的安装及配置(Config MySQL Control Center)
    Windows下,MySql的安装及配置(Install and Config of MySQL in Windows)
    软件使用说明书
    Windows 8 Customer Preview使用心得
    How to Choose a secure password,Ubuntu tell you!
  • 原文地址:https://www.cnblogs.com/lizm166/p/11125471.html
Copyright © 2011-2022 走看看