Bootstrap

SpringBoot 常用依赖

项目依赖版本规约

一、JDK版本

​ JDK 1.8 191

二、SpringBoot依赖

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

三、SpringBoot常用依赖

1、spring-boot-starter

​ 备注:(核心Spring Boot starter ,包括自动配置支持,日志和YAML)

<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter</artifactId>
</dependency>

2、spring-boot-starter-actuator

​ 备注: (生产准备的特性,用于帮你监控和管理应用)

<!--生产准备的特性,用于帮你监控和管理应用  -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

3、spring-boot-starter-aop

​ 备注:(对面向切面变成的支持,通过spring-aop和AspectJ )

<!--对面向切面变成的支持,通过spring-aop和AspectJ -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-aop</artifactId>
</dependency>

4、spring-boot-starter-batch

​ 备注:(对Spring batch 的支持,包括HSQLDB数据库 )

<!--对Spring batch 的支持,包括HSQLDB数据库  -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-batch</artifactId>
</dependency>

5、spring-boot-starter-cloud-connection

​ 备注:(对Spring Cloud Connection的支持,简化在云平台下(例如,Cloud Foundry和Heroku)服务        的连接)

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-cloud-connection</artifactId>
</dependency>

6、spring-boot-starter-data-gemfire

​ 备注:(对GemFire分布式数据存储的支持,包括spring-data-gemfir)

<!--对GemFire分布式数据存储的支持,包括spring-data-gemfire-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-gemfire</artifactId>
</dependency>

7、spring-boot-starter-data-rest

​ 备注: (通过对REST暴露Spring data仓库的支持,通过spring-data-rest-webmvc实现)

 <!--通过对REST暴露Spring data仓库的支持,通过Spring-data-rest-webmvc实现-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>

8、spring-boot-starter-Groovy

​ 备注:(对Groovy模板引擎的支持)

<!--对Groovy模板引擎的支持-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-groovy</artifactId>
</dependency>

9、spring-boot-starter-hateoas

​ 备注: (对基于HATEOAS的RESTful服务的支持,通过spring-hateoa)

<!--对基于HATEOAS的RESTful服务的支持,通过Spring-hateoas;-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-hateoas</artifactId>
</dependency>

10、spring-boot-starter-integration

​ 备注:(对普通spring-integration模块的支持)

<!--对普通Spring-integration模块的支持-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-integration</artifactId>
</dependency>

11、spring-boot-starter-hornetq

​ 备注:(对”java消息服务API”的支持,通过HornetQ实现)

<!--(对”java消息服务API”的支持,通过HornetQ实现-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-hornetq</artifactId>
</dependency>

12、spring-boot-starter-jersey

​ 备注:(对Jersey RESTful Web服务框架的支持)

<!--对Jersey RESTful Web服务框架的支持-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jersey</artifactId>
</dependency>

13、spring-boot-starter-jta-atomikos

​ 备注:(对JTA分布式事务的支持。通过Atomikos实现)

<!--对JTA分布式事务的支持,通过Atomikos-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jta-atomikos</artifactId>
</dependency>

14、spring-boot-starter-jta-bitronix

​ 备注: (对JTA分布式事务的支持,通过Bitronix实现)

<!--对JTA分布式事务的支持,通过Bitronix实现-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jta-bitronix</artifactId>
</dependency>

15、spring-boot-starter-mobile

​ 备注:(对spring-mobile的支持)

<!--对spring-mobile的支持-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-mobile</artifactId>
</dependency>

16、spring-boot-starter-social-facebook

​ 备注:(对spring-social-facebook的支持)

<!--对spring-social-facebook的支持-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-social-facebook</artifactId>
</dependency>

17、spring-boot-starter-social-twitter

​ 备注: (对spring-social-twitter的支持)

<!--对spring-social-twitter的支持-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-social-twitter</artifactId>
</dependency>

18、spring-boot-starter-thymeleaf

​ 备注:(对Thymeleaf模板引擎的支持,包括和Spring的集成)

<!--对Thymeleaf模板引擎的支持,包括和Spring的集成-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

19、spring-boot-starter-velocity

​ 备注: (对velocity模板引擎的支持)

<!--对velocity模板引擎的支持-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-velocity</artifactId>
</dependency>

20、spring-boot-starter-web

​ 备注:(对全栈web开发的支持,包括Tomcat和spring-webmvc)

<!--对全栈web开发的支持,包括Tomcat和spring-webmvc-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>

21、spring-boot-starter-websocket

​ 备注:(对websocket开发的支持)

<!--对websocket开发的支持-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-websocket</artifactId>
</dependency>

22、spring-boot-starter-ws

​ 备注:(对Spring web服务的支持)

<!--对Spring web服务的支持-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-ws</artifactId>
</dependency>

23、spring-boot-starter-jetty

​ 备注: (导入Jetty HTTP引擎(作为Tomcat的代替))

<!--导入Jetty HTTP引擎(作为Tomcat的代替-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jetty</artifactId>
</dependency>

24、spring-boot-starter-logging

​ 备注:(对Log4J日志系统的支持)

<!--对Log4J日志系统的支持-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-log4j</artifactId>
</dependency>

25、spring-boot-starter-tomcat

​ 备注: (导入SpringBoot的默认HTTP引擎(Tomcat))

<!--导入SpringBoot的默认HTTP引擎(Tomcat-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>

26、pring-boot-starter-undertow

​ 备注: (导入Undertow HTTP引擎(作为tomcat的代替))

<!--导入Undertow HTTP引擎(作为tomcat的代替-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-undertow</artifactId>
</dependency>

四、持久层

1、Mybatis+Mapper

<mybatis-spring-boot-starter.version>1.3.2</mybatis-spring-boot-starter.version>
<!--最新版本 2.0.0 -->
<dependency>
    <groupId>org.mybatis.spring.boot</groupId>
    <artifactId>mybatis-spring-boot-starter</artifactId>
    <version>${mybatis-spring-boot-starter.version}</version>
</dependency>
<mapper-spring-boot-starter.version>1.1.7</mapper-spring-boot-starter.version>
<!--最新版本 2.1.5 -->
<dependency>
    <groupId>tk.mybatis</groupId>
    <artifactId>mapper-spring-boot-starter</artifactId>
    <version>${mapper-spring-boot-starter.version}</version>
</dependency>

2、spring-boot-starter-data-jpa

​ 备注:(对java持久化API的支持,包括Spring-data-jpa,spring-orm和Hibernate)

<!--对java持久化API的支持,包括Spring-data-jpa,spring-orm和Hibernate-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

3、对象关系映射

​ 备注:(对象关系映射)

<!-- https://mvnrepository.com/artifact/org.springframework/spring-orm -->
<spring-orm.version>5.1.5.RELEASE</spring-orm.version>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-orm</artifactId>
    <version>${spring-orm.version}</version>
</dependency>

4、hibernate

<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
<hibernate-core.version>5.4.1.Final</hibernate-core.version>
<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>${hibernate-core.version}</version>
</dependency>


五、关系型数据库

1、JDBC

spring-boot-starter-jdbc(对JDBC数据库的支持)

<!--对JDBC数据库的支持-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>

2、MySQL

​ MySQL驱动

<mysql-connector-java.version>6.0.6</mysql-connector-java.version>
<!--最新版本 8.0.15 -->
<!-- mysql驱动 -->
<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
</dependency>

3、Oracle

​ Oracle驱动

<oracle.version>11.2</oracler.version>
<!--最新版本 21.0 -->
<dependency>
   <groupId>org.oracle</groupId>
   <artifactId>oracle</artifactId>
   <version>${oracle.version}</version>
</dependency>

六、非关系型数据库

1、spring-boot-starter-data-mongodb

​ 备注:(对MongoDB NOSQL数据库的支持,包括spring-data-mongodb)

<!--对MongoDB NOSQL数据库的支持,包括spring-data-mongodb-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>

2、spring-boot-starter-redis

​ 备注: (对REDIS键值数据存储的支持,包括Spring-redis)

<!--对REDIS键值数据存储的支持,包括Spring-redis-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-redis</artifactId>
</dependency>

七、连接池

1、Druid

<druid.version>1.1.5</druid.version>
<!--最新版本 1.1.14 -->
<dependency>  
    <groupId>com.alibaba</groupId>  
    <artifactId>druid</artifactId>  
    <version>${druid.version}</version>  
</dependency>


2、HikariCP(版本自带)

<dependency>
   <groupId>com.zaxxer</groupId>
   <artifactId>HikariCP</artifactId>
</dependency>

八、消息中间件

1、spring-boot-starter-amqp

​ 备注:(对高级消息队列协议的支持,通过spring-rabbit实现)

<!--对高级消息队列协议的支持,通过SpringBoot-rabbit实现  -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-amqp</artifactId>
</dependency>

2、spring-boot-starter-activemq(activeMQ中间件)

<dependency>
     <groupId>org.springframework.boot</groupId>
     <artifactId>spring-boot-starter-activemq</artifactId>
</dependency>

九、索引库及分词器

1、spring-boot-starter-data-solr

​ 备注:(对Apache Solr搜索平台的支持,包括spring-data-solr)

<!--对Apache Solr搜索平台的支持,包括spring-data-solr-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-solr</artifactId>
</dependency>

2、spring-boot-starter-elasticsearch

​ 备注:(对Elasticsearche搜索和分析引擎的支持,包括spring-data-elasticsearch)

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-elasticsearch</artifactId>
</dependency>

3、分词器

​ 备注(中文分词搜索)

<ikanalyzer.version>2012_u6</ikanalyzer.version>
<dependency>
   <groupId>com.janeluo</groupId>
   <artifactId>ikanalyzer</artifactId>
   <version>${ikanalyzer.version}</version>
</dependency>

十、权限控制

1、spring-boot-starter-security

​ 备注: (对spring -security模板引擎的支持)

<!--对spring -security模板引擎的支持-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-security</artifactId>
</dependency>

2、shiro

​ 备注:(权限控制)

<shrio-spring.version>1.4.0</shrio-spring.version>
<dependency>
    <groupId>org.apache.shiro</groupId>
    <artifactId>shiro-spring</artifactId>
    <version>${shrio-spring.version}</version>
</dependency>

十一、监控中心及注册中心

1、Dubbo+Zookeeper

<dubbo-spring-boot-starter.version>0.2.1.RELEASE</dubbo-spring-boot.version>
<dependency>
    <groupId>com.alibaba.boot</groupId>
    <artifactId>dubbo-spring-boot-starter</artifactId>
    <version>${dubbo-spring-boot-starter.version}</version>
</dependency>

2、springCloud

​ (父工程)

	<dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Finchley.M9</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
	</dependencyManagement>

​ springCloud+eureka 模块(注册)

<dependency>
	<groupId>org.springframework.cloud</groupId>
	<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>


​ springCloud+客户端(调用)

<dependency>
	<groupId>org.springframework.cloud</groupId>
	<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>

<dependency>
	<groupId>org.springframework.cloud</groupId>
	<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>

十二、测试

​spring-boot-starter-test

(对常用测试依赖的支持,包括JUnit,Hamcrest和Mockito还有spring-test模块)

<!--对常用测试依赖的支持,包括JUnit,Hamcrest和Mockito还有Spring-test模块-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-test</artifactId>
</dependency>

十三、JSON格式转换

1、fastjson

<fastjson.version>1.2.16</fastjson.version>
<!--最新版本 1.2.56 -->
<dependency>
   <groupId>com.alibaba</groupId>
   <artifactId>fastjson</artifactId>
   <version>${fastjson.version}</version>
</dependency>

2、jackson

<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
<jackson-databind.version>2.9.8</jackson-databindversion>
<dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-databind</artifactId>
    <version>${jackson-databind.version}</version>
</dependency>

3、gson

<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<gson.version>2.8.5</gson.version>
<dependency>
    <groupId>com.google.code.gson</groupId>
    <artifactId>gson</artifactId>
    <version>${gson.version}</version>
</dependency>

十四、commons组件

1、lang3

​ 备注:(用于java.lang层次结构中的类,或被认为是标准的,以证明java.lang中的存在)

<commons.lang3.version>3.7</commons.lang3.version>
<!--最新版本  commons.lang3 3.8.1 -->
<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-lang3</artifactId>
    <version>${commons.lang3.version}</version>
</dependency>


2、io

​ 备注:(包含实用程序类,流实现,文件过滤器,文件比较器,endian转换类等等)

<commons.io.version>2.6</commons.io.version>
<dependency>
    <groupId>commons-io</groupId>
    <artifactId>commons-io</artifactId>
    <version>${commons.io.version}</version>
</dependency>

3、collections4

​ 备注:(扩展和扩充Java Collections Framework的类型)

<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-collections4 -->
<commons-collections4.version>4.3<commons-collections4.version>
<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-collections4</artifactId>
    <version>${commons-collections4.version}</version>
</dependency>

4、logging

​ 备注:(允许与其他众所周知的日志记录系统进行可配置的桥接)

<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
<commons-logging.version>1.2</commons-logging.version>
<dependency>
    <groupId>commons-logging</groupId>
    <artifactId>commons-logging</artifactId>
    <version>${commons-logging.version}</version>
</dependency>


十五、常用工具

1、监控

<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

2、日志

​ 1、log4j2

<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>

​ 2、slf4j

<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
<slf4j-api.version>1.8.0-beta4</slf4j-api.version>
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>${slf4j-api.version}</version>
</dependency>

3、lombok

​ 备注:(简化JavaBean开发)

<lombok.version>1.8.16</lombok.version>
<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <version>${lombok.version}</version>
</dependency>

4、pagehelper-spring-boot-start

​ 备注:(分页插件)

<pagehelper-spring-boot-starter.version>1.25</pagehelper-spring-boot-starter>
<!--最新版本 1.2.10-->
<dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>pagehelper-spring-boot-starter</artifactId>
    <version>${pagehelper-spring-boot-starter.version}</version>
</dependency>

5、spring-boot-starter-freemaker

​ 备注:(对FreeMarker模板引擎的支持)

<!--对FreeMarker模板引擎的支持-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>

6、spring-boot-starter-mail

​ 备注:(对javax.mail的支持)

<!--对javax.mail的支持-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-mail</artifactId>
</dependency>

7、 文件上传

<commons-fileupload.version>1.3.1</commons-fileupload.version>
<!--最新版本 1.4 -->
<fastdfs-client.version>1.25-RELEASE</fastdfs-client.version>
<!--最新版本 1.27-RELEASE -->
<dependency>
    <groupId>commons-fileupload</groupId>
    <artifactId>commons-fileupload</artifactId>
    <version>${commons-fileupload.version}</version>
</dependency>
<dependency>
    <groupId>org.csource</groupId>
    <artifactId>fastdfs-client</artifactId>
    <version>${fastdfs-client.version}</version>
</dependency>

8、POI导入/导出

<poi.version>3.16</poi.version>
<poi-ooxml.version>3.14</poi-ooxml.version>
<!--最新版本 4.0.1-->
<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi</artifactId>
    <version>${poi.version}</version>
</dependency>
<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-ooxml</artifactId>
    <version>${poi-ooxml.version}</version>
</dependency>

9、activiti 工作流

<activiti-engine.version>7-201802-EA</activiti-engine.version>
<dependency>
    <groupId>org.activiti</groupId>
    <artifactId>activiti-engine</artifactId>
    <version>${activiti-engine.version}</version>
</dependency>

10、验证码

<kaptcha.version>2.3.2</kaptcha.version>
<dependency>
    <groupId>com.github.penggle</groupId>
    <artifactId>kaptcha</artifactId>
    <version>${kaptcha.version}</version>
</dependency>

11、阿里大于发送短信

<aliyun-java-sdk-core.version>3.3.1</aliyun-java-sdk-core.version>
<!--最新版本 4.3.5 -->
<aliyun-java-sdk-dysmsapi.version>1.0.0</aliyun-java-sdk-dysmsapi.version>
<!--最新版本 1.1.0 -->
<dependency>
    <groupId>com.aliyun</groupId>
    <artifactId>aliyun-java-sdk-core</artifactId>
    <version>${aliyun-java-sdk-core.version}</version>
</dependency>
<dependency>
    <groupId>com.aliyun</groupId>
    <artifactId>aliyun-java-sdk-dysmsapi</artifactId>
    <version>${aliyun-java-sdk-dysmsapi.version}</version>
</dependency>

12、微信支付

<wxpay-sdk.version>0.0.3</wxpay-sdk.version>
<dependency>
    <groupId>com.github.wxpay</groupId>
    <artifactId>wxpay-sdk</artifactId>
    <version>${wxpay-sdk.version}</version>
</dependency>

13、支付宝支付

<sdk-alipay-starter.version>3.7.4.ALL</sdk-alipay-starter.version>
<dependency>
    <groupId>net.guerlab</groupId>
    <artifactId>alipay-sdk-java</artifactId>
    <version>${sdk-alipay-starter.version}</version>
</dependency>

14、热部署

<!--最新版本 2.1.3.RELEASE-->
<spring-boot-devtools.version>2.1.3.RELEASE</spring-boot-devtools>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <optional>true</optional>
    <scope>true</scope>
</dependency>

​ 15、httpclient

<!--最新版本 4.5.7 -->
<httpclient.version>4.5.7</httpclient.version>
<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpclient</artifactId>
</dependency>

16、joda-time

​ 备注:(用于替换JDK日期处理的日期和时间库)

<!-- https://mvnrepository.com/artifact/joda-time/joda-time -->
<joda-time.version>2.10.1</joda-time.version>
<dependency>
    <groupId>joda-time</groupId>
    <artifactId>joda-time</artifactId>
    <version>${joda-time.version}</version>
</dependency>


;