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

相關文章
相關標籤/搜索