Spring Boot | 1.5 pom源码分析

扫码关注公众号:Java 技术驿站

发送:vip
将链接复制到本浏览器,永久解锁本站全部文章

【公众号:Java 技术驿站】 【加作者微信交流技术,拉技术群】

Spring Boot目录汇总地址:
https://blog.csdn.net/mengmengdastyle/article/details/80357203
一、pom父工程
(1)每个Spring Boot工程中,都需要继承一个父类。

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.2.RELEASE</version>
    </parent>

(2)点击可以看到它的父项目的关系:

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.2.RELEASE</version>
    </parent>

    他的父项目是
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>2.0.2.RELEASE</version>
        <relativePath>../../spring-boot-dependencies</relativePath>
    </parent>

关系图为:20191102100543\_1.png
二、spring-boot-dependencies项目
(1)在spring-boot-dependencies里面可以看到应用的所有依赖及版本:
以后我们导入依赖默认是不需要写版本;

    <properties>
        <activemq.version>5.15.3</activemq.version>
        <antlr2.version>2.7.7</antlr2.version>
        <appengine-sdk.version>1.9.63</appengine-sdk.version>
        <artemis.version>2.4.0</artemis.version>
        <aspectj.version>1.8.13</aspectj.version>
        <assertj.version>3.9.1</assertj.version>
        <atomikos.version>4.0.6</atomikos.version>
        <bitronix.version>2.1.4</bitronix.version>
        <build-helper-maven-plugin.version>3.0.0</build-helper-maven-plugin.version>
        <byte-buddy.version>1.7.11</byte-buddy.version>
        <caffeine.version>2.6.2</caffeine.version>
        <cassandra-driver.version>3.4.0</cassandra-driver.version>
        <classmate.version>1.3.4</classmate.version>
        <commons-codec.version>1.11</commons-codec.version>
        <commons-dbcp2.version>2.2.0</commons-dbcp2.version>
        <commons-lang3.version>3.7</commons-lang3.version>
        <commons-pool.version>1.6</commons-pool.version>
        <commons-pool2.version>2.5.0</commons-pool2.version>
        <couchbase-cache-client.version>2.1.0</couchbase-cache-client.version>
        <couchbase-client.version>2.5.8</couchbase-client.version>
        <derby.version>10.14.1.0</derby.version>
        <dom4j.version>1.6.1</dom4j.version>
        <dropwizard-metrics.version>3.2.6</dropwizard-metrics.version>
        <ehcache.version>2.10.4</ehcache.version>
        <ehcache3.version>3.5.2</ehcache3.version>
        <elasticsearch.version>5.6.9</elasticsearch.version>
        <embedded-mongo.version>2.0.3</embedded-mongo.version>
        <exec-maven-plugin.version>1.5.0</exec-maven-plugin.version>
        <flatten-maven-plugin.version>1.0.0</flatten-maven-plugin.version>
        <flyway.version>5.0.7</flyway.version>
        <freemarker.version>2.3.28</freemarker.version>
        <git-commit-id-plugin.version>2.2.3</git-commit-id-plugin.version>
        <glassfish-el.version>3.0.0</glassfish-el.version>
        <groovy.version>2.4.15</groovy.version>
        <gson.version>2.8.4</gson.version>
        <h2.version>1.4.197</h2.version>
        <hamcrest.version>1.3</hamcrest.version>
        <hazelcast.version>3.9.4</hazelcast.version>
        <hazelcast-hibernate5.version>1.2.3</hazelcast-hibernate5.version>
        <hibernate.version>5.2.17.Final</hibernate.version>
        <hibernate-validator.version>6.0.9.Final</hibernate-validator.version>
        <hikaricp.version>2.7.9</hikaricp.version>
        <hsqldb.version>2.4.0</hsqldb.version>
        <htmlunit.version>2.29</htmlunit.version>
        <httpasyncclient.version>4.1.3</httpasyncclient.version>
        <httpclient.version>4.5.5</httpclient.version>
        <httpcore.version>4.4.9</httpcore.version>
        <infinispan.version>9.1.7.Final</infinispan.version>
        <influxdb-java.version>2.9</influxdb-java.version>
        <jackson.version>2.9.5</jackson.version>
        <janino.version>3.0.8</janino.version>
        <javax-annotation.version>1.3.2</javax-annotation.version>
        <javax-cache.version>1.1.0</javax-cache.version>
        <javax-jaxb.version>2.3.0</javax-jaxb.version>
        <javax-jms.version>2.0.1</javax-jms.version>
        <javax-json.version>1.1.2</javax-json.version>
        <javax-jsonb.version>1.0</javax-jsonb.version>
        <javax-mail.version>1.6.1</javax-mail.version>
        <javax-money.version>1.0.3</javax-money.version>
        <javax-transaction.version>1.2</javax-transaction.version>
        <javax-validation.version>2.0.1.Final</javax-validation.version>
        <jaxen.version>1.1.6</jaxen.version>
        <jaybird.version>3.0.4</jaybird.version>
        <jboss-logging.version>3.3.2.Final</jboss-logging.version>
        <jboss-transaction-spi.version>7.6.0.Final</jboss-transaction-spi.version>
        <jdom2.version>2.0.6</jdom2.version>
        <jedis.version>2.9.0</jedis.version>
        <jersey.version>2.26</jersey.version>
        <jest.version>5.3.3</jest.version>
        <jetty.version>9.4.10.v20180503</jetty.version>
        <jetty-el.version>8.5.24.2</jetty-el.version>
        <jetty-jsp.version>2.2.0.v201112011158</jetty-jsp.version>
        <jmustache.version>1.14</jmustache.version>
        <jna.version>4.5.1</jna.version>
        <joda-time.version>2.9.9</joda-time.version>
        <johnzon-jsonb.version>1.1.7</johnzon-jsonb.version>
        <jolokia.version>1.5.0</jolokia.version>
        <jooq.version>3.10.7</jooq.version>
        <jsonassert.version>1.5.0</jsonassert.version>
        <json-path.version>2.4.0</json-path.version>
        <jstl.version>1.2</jstl.version>
        <jtds.version>1.3.1</jtds.version>
        <junit.version>4.12</junit.version>
        <junit-jupiter.version>5.1.1</junit-jupiter.version>
        <junit-platform.version>1.1.0</junit-platform.version>
        <kafka.version>1.0.1</kafka.version>
        <kotlin.version>1.2.41</kotlin.version>
        <lettuce.version>5.0.4.RELEASE</lettuce.version>
        <liquibase.version>3.5.5</liquibase.version>
        <log4j2.version>2.10.0</log4j2.version>
        <logback.version>1.2.3</logback.version>
        <lombok.version>1.16.20</lombok.version>
        <mariadb.version>2.2.3</mariadb.version>
        <maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
        <maven-assembly-plugin.version>3.1.0</maven-assembly-plugin.version>
        <maven-clean-plugin.version>3.0.0</maven-clean-plugin.version>
        <maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
        <maven-dependency-plugin.version>3.0.2</maven-dependency-plugin.version>
        <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
        <maven-eclipse-plugin.version>2.10</maven-eclipse-plugin.version>
        <maven-enforcer-plugin.version>3.0.0-M1</maven-enforcer-plugin.version>
        <maven-failsafe-plugin.version>2.21.0</maven-failsafe-plugin.version>
        <maven-help-plugin.version>2.2</maven-help-plugin.version>
        <maven-install-plugin.version>2.5.2</maven-install-plugin.version>
        <maven-invoker-plugin.version>3.0.0</maven-invoker-plugin.version>
        <maven-jar-plugin.version>3.0.2</maven-jar-plugin.version>
        <maven-javadoc-plugin.version>3.0.0</maven-javadoc-plugin.version>
        <maven-resources-plugin.version>3.0.1</maven-resources-plugin.version>
        <maven-shade-plugin.version>2.4.3</maven-shade-plugin.version>
        <maven-site-plugin.version>3.6</maven-site-plugin.version>
        <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
        <maven-surefire-plugin.version>2.21.0</maven-surefire-plugin.version>
        <maven-war-plugin.version>3.1.0</maven-war-plugin.version>
        <micrometer.version>1.0.4</micrometer.version>
        <mockito.version>2.15.0</mockito.version>
        <mongodb.version>3.6.3</mongodb.version>
        <mongo-driver-reactivestreams.version>1.7.1</mongo-driver-reactivestreams.version>
        <mssql-jdbc.version>6.2.2.jre8</mssql-jdbc.version>
        <mysql.version>5.1.46</mysql.version>
        <narayana.version>5.8.1.Final</narayana.version>
        <nekohtml.version>1.9.22</nekohtml.version>
        <neo4j-ogm.version>3.1.0</neo4j-ogm.version>
        <netty.version>4.1.24.Final</netty.version>
        <nio-multipart-parser.version>1.1.0</nio-multipart-parser.version>
        <postgresql.version>42.2.2</postgresql.version>
        <quartz.version>2.3.0</quartz.version>
        <querydsl.version>4.1.4</querydsl.version>
        <rabbit-amqp-client.version>5.1.2</rabbit-amqp-client.version>
        <reactive-streams.version>1.0.2</reactive-streams.version>
        <reactor-bom.version>Bismuth-SR9</reactor-bom.version>
        <rest-assured.version>3.0.7</rest-assured.version>
        <rxjava.version>1.3.8</rxjava.version>
        <rxjava2.version>2.1.13</rxjava2.version>
        <rxjava-adapter.version>1.2.1</rxjava-adapter.version>
        <selenium.version>3.9.1</selenium.version>
        <selenium-htmlunit.version>2.29.3</selenium-htmlunit.version>
        <sendgrid.version>4.1.2</sendgrid.version>
        <servlet-api.version>3.1.0</servlet-api.version>
        <simple-json.version>1.1.1</simple-json.version>
        <slf4j.version>1.7.25</slf4j.version>
        <snakeyaml.version>1.19</snakeyaml.version>
        <solr.version>6.6.3</solr.version>
        <spring.version>5.0.6.RELEASE</spring.version>
        <spring-amqp.version>2.0.3.RELEASE</spring-amqp.version>
        <spring-batch.version>4.0.1.RELEASE</spring-batch.version>
        <spring-cloud-connectors.version>2.0.1.RELEASE</spring-cloud-connectors.version>
        <spring-data-releasetrain.version>Kay-SR7</spring-data-releasetrain.version>
        <spring-hateoas.version>0.24.0.RELEASE</spring-hateoas.version>
        <spring-integration.version>5.0.5.RELEASE</spring-integration.version>
        <spring-kafka.version>2.1.6.RELEASE</spring-kafka.version>
        <spring-ldap.version>2.3.2.RELEASE</spring-ldap.version>
        <spring-plugin.version>1.2.0.RELEASE</spring-plugin.version>
        <spring-restdocs.version>2.0.1.RELEASE</spring-restdocs.version>
        <spring-retry.version>1.2.2.RELEASE</spring-retry.version>
        <spring-security.version>5.0.5.RELEASE</spring-security.version>
        <spring-session-bom.version>Apple-SR2</spring-session-bom.version>
        <spring-ws.version>3.0.1.RELEASE</spring-ws.version>
        <sqlite-jdbc.version>3.21.0.1</sqlite-jdbc.version>
        <statsd-client.version>3.1.0</statsd-client.version>
        <sun-mail.version>1.6.1</sun-mail.version>
        <thymeleaf.version>3.0.9.RELEASE</thymeleaf.version>
        <thymeleaf-extras-data-attribute.version>2.0.1</thymeleaf-extras-data-attribute.version>
        <thymeleaf-extras-java8time.version>3.0.1.RELEASE</thymeleaf-extras-java8time.version>
        <thymeleaf-extras-springsecurity4.version>3.0.2.RELEASE</thymeleaf-extras-springsecurity4.version>
        <thymeleaf-layout-dialect.version>2.3.0</thymeleaf-layout-dialect.version>
        <tomcat.version>8.5.31</tomcat.version>
        <unboundid-ldapsdk.version>4.0.5</unboundid-ldapsdk.version>
        <undertow.version>1.4.25.Final</undertow.version>
        <versions-maven-plugin.version>2.3</versions-maven-plugin.version>
        <webjars-hal-browser.version>3325375</webjars-hal-browser.version>
        <webjars-locator-core.version>0.35</webjars-locator-core.version>
        <wsdl4j.version>1.6.3</wsdl4j.version>
        <xml-apis.version>1.4.01</xml-apis.version>
        <xml-maven-plugin.version>1.0.1</xml-maven-plugin.version>
        <xmlunit2.version>2.5.1</xmlunit2.version>
    </properties>

(2)启动器
Spring Boot将所有的功能场景都抽取出来,做成一个个的starter(启动器),只需要在项目里面引入这些starter相关场景的所有依赖都会导入进来。。

Spring Boot推荐基础POM文件

名称 说明
spring-boot-starter 核心POM,包含自动配置支持、日志库和对YAML配置文件的支持。
spring-boot-starter-amqp 通过spring-rabbit支持AMQP。
spring-boot-starter-aop 包含spring-aop和AspectJ来支持面向切面编程(AOP)。
spring-boot-starter-batch 支持SpringBatch,包含HSQLDB。
spring-boot-starter-data-jpa 包含spring-data-jpa、spring-orm和Hibernate来支持JPA。
spring-boot-starter-data-mongodb 包含spring-data-mongodb来支持MongoDB。
spring-boot-starter-data-rest 通过spring-data-rest-webmvc支持以REST方式暴露SpringData仓库。
spring-boot-starter-jdbc 支持使用JDBC访问数据库。
spring-boot-starter-security 包含spring-security。
spring-boot-starter-test 包含常用的测试所需的依赖,如JUnit、Hamcrest、Mockito和spring-test等。
spring-boot-starter-velocity 支持使用Velocity作为模板引擎。
spring-boot-starter-web 支持Web应用开发,包含Tomcat和spring-mvc。
spring-boot-starter-websocket 支持使用Tomcat开发WebSocket应用。
spring-boot-starter-ws 支持SpringWebServices。
spring-boot-starter-actuator 添加适用于生产环境的功能,如性能指标和监测等功能。
spring-boot-starter-remote-shell 添加远程SSH支持。
spring-boot-starter-jetty 使用Jetty而不是默认的Tomcat作为应用服务器。
spring-boot-starter-log4j 添加Log4j的支持。
spring-boot-starter-logging 使用SpringBoot默认的日志框架Logback。
spring-boot-starter-tomcat 使用SpringBoot默认的Tomcat作为应用服务器。

三、spring-boot-starter-parent
在parent项目中有一些基本的设置

    <properties>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <resource.delimiter>@</resource.delimiter>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.target>${java.version}</maven.compiler.target>
    </properties>

来源:http://ddrv.cn

赞(0) 打赏
版权归原创作者所有,任何形式的转载请联系博主:daming_90:Java 技术驿站 » Spring Boot | 1.5 pom源码分析

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏