SpringBoot之依赖分析

注:SpringBoot的版本是1.4.8。java

              

                                                   图1 SpringBoot的模块继承图git

    图1的原图在Github上。github

                 

                                                  图2 SpringBoot-1.4.8源码目录结构spring

  • spring-boot-dependencies中无Java代码,它的dependencyManagement中定义了不少依赖,并指定了版本。
  • spring-boot-starter-parent中无Java代码,它的dependencyManagement中,spring-core依赖排除commons-logging依赖,以下所示:
<dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
			<version>${spring.version}</version>
			<exclusions>
				<exclusion>
					<groupId>commons-logging</groupId>
					<artifactId>commons-logging</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
	</dependencies>
</dependencyManagement>
  • spring-boot-parent中无Java代码,它的dependencyManagement中新增了一些依赖。
  • spring-boot中,是启动应用的源码。
  • spring-boot-starters是个pom,包含了不少子module。
  • spring-boot-starter中无Java代码,但它的dependencies添加了一些依赖,代码以下:
<dependencies>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-autoconfigure</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-logging</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-core</artifactId>
		<exclusions>
			<exclusion>
				<groupId>commons-logging</groupId>
				<artifactId>commons-logging</artifactId>
			</exclusion>
		</exclusions>
	</dependency>
	<dependency>
		<groupId>org.yaml</groupId>
		<artifactId>snakeyaml</artifactId>
		<scope>runtime</scope>
	</dependency>
</dependencies>

 

Reference:springboot

1. SpringBoot-1.4.8的Github: https://github.com/spring-projects/spring-boot/tree/1.4.xspring-boot

相关文章
相关标签/搜索