赞
踩
1、核心依赖:
spring-boot-dependencies:配置版本是2.6.14。
spring-cloud-dependencies:配置版本是2021.0.3。
spring-cloud-alibaba-dependencies:配置版本是1.4.2。
需要在dependencyManagement中进行配置,配置步骤如下:
- <properties>
- <maven.compiler.source>8</maven.compiler.source>
- <maven.compiler.target>8</maven.compiler.target>
-
- <!-- 核心依赖 -->
- <spring-boot.version>2.6.14</spring-boot.version>
- <spring-cloud.version>2021.0.3</spring-cloud.version>
- <spring-cloud.alibaba.version>2021.1</spring-cloud.alibaba.version>
- </properties>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-dependencies</artifactId>
- <version>${spring-boot.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
-
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-dependencies</artifactId>
- <version>${spring-cloud.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
-
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-alibaba-dependencies</artifactId>
- <version>${spring-cloud.alibaba.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
2、数据校验、全局异常拦截依赖
spring-boot-starter-validation:版本与springboot版本一致:
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-validation</artifactId>
- <version>${spring-boot.version}</version>
- </dependency>
3、nacos依赖
nacos-client:nacos依赖 版本:2.1.0
- <dependency>
- <groupId>com.alibaba.nacos</groupId>
- <artifactId>nacos-client</artifactId>
- <version>${nacos.version}</version>
- </dependency>
4、redis依赖
spring-boot-starter-data-redis:redis 依赖版本:同springboot
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-data-redis</artifactId>
- <version>${spring-boot.version}</version>
- </dependency>
5、数据库相关依赖
spring-boot-starter-data-jdbc 依赖版本:同springboot
mysql-connector-java 依赖版本:同数据库安装版本
mybatis-plus-boot-starter 依赖版本:3.5.1
mybatis-plus-generator 代码生成器 依赖版本:3.5.1
mybatis-plus-extension mp扩展插件依赖 版本:同mp
mybatisplus-plus 对mp的补充 版本:1.7.0-RELEASE
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-data-jdbc</artifactId>
- <version>${spring-boot.version}</version>
- </dependency>
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>${mysql-connector.version}</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>com.baomidou</groupId>
- <artifactId>mybatis-plus-boot-starter</artifactId>
- <version>${mybatis-plus-starter.version}</version>
- </dependency>
- <dependency>
- <groupId>com.baomidou</groupId>
- <artifactId>mybatis-plus-generator</artifactId>
- <version>${mybatis-plus-generator.version}</version>
- </dependency>
- <dependency>
- <groupId>com.baomidou</groupId>
- <artifactId>mybatis-plus-extension</artifactId>
- <version>${mybatis-plus-starter.version}</version>
- </dependency>
- <dependency>
- <groupId>com.github.jeffreyning</groupId>
- <artifactId>mybatisplus-plus</artifactId>
- <version>${jeffreyning.mybatisplus-plus.version}</version>
- </dependency>
<scope>runtime</scope> 代表测试和运行时需要。
6、fastjson JSON互转依赖;
fastjson:配置版本是 1.2.83
- <dependency>
- <groupId>com.alibaba</groupId>
- <artifactId>fastjson</artifactId>
- <version>${fastjson.version}</version>
- </dependency>
7、http封装依赖:
okhttp:配置版本是4.9.0
httpclient:配置版本是:4.5.13
- <dependency>
- <groupId>com.squareup.okhttp3</groupId>
- <artifactId>okhttp</artifactId>
- <version>${okhttp3.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- <version>${httpclient.version}</version>
- </dependency>
8、hutool依赖、commons-lang3依赖,提供各种工具类:
hutool-all:配置版本:5.7.12
commons-lang3:配置版本:3.12.0
- <dependency>
- <groupId>cn.hutool</groupId>
- <artifactId>hutool-all</artifactId>
- <version>${hutool.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- <version>${commons-lang3.version}</version>
- </dependency>
也可以选择引入hutool-bom:
- <dependency>
- <groupId>cn.hutool</groupId>
- <artifactId>hutool-bom</artifactId>
- <version>${hutool.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
all和bom区别如下:
all将所有模块打包成一个jar,因此在你的项目中只有一个hutool-all的jar包,你也无法选择去除哪些模块。
bom则是默认引入所有模块,你可以通过exclude标签排除不需要的模块,减少整个项目体积。
9、jsoup 爬虫工具类:
jsoup:配置版本:1.13.1
- <dependency>
- <groupId>org.jsoup</groupId>
- <artifactId>jsoup</artifactId>
- <version>${jsoup.version}</version>
- </dependency>
10、gateway
spring-cloud-starter-gateway:配置版本:3.0.7
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-gateway</artifactId>
- <version>${gateway.version}</version>
- </dependency>
11、Quartz定时任务调度框架
spring-boot-starter-quartz:配置版本同springboot
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-quartz</artifactId>
- <version>${spring-boot.version}</version>
- </dependency>
12、模板引擎freemarker
freemarker:依赖版本:2.3.30
- <dependency>
- <groupId>org.freemarker</groupId>
- <artifactId>freemarker</artifactId>
- <version>${freemarker.version}</version>
- </dependency>
13、Logback日志框架:
logstash-logback-encoder: 依赖版本:7.2
- <dependency>
- <groupId>net.logstash.logback</groupId>
- <artifactId>logstash-logback-encoder</artifactId>
- <version>${logstash-logback-encoder.version}</version>
- </dependency>
14、poi-tl Word模板引擎
poi-tl :依赖版本 1.10.5
- <dependency>
- <groupId>com.deepoove</groupId>
- <artifactId>poi-tl</artifactId>
- <version>${poi-tl.version}</version>
- </dependency>
15 、easyexcel
easyexcel :依赖版本 3.2.1
- <dependency>
- <groupId>com.alibaba</groupId>
- <artifactId>easyexcel</artifactId>
- <version>${easyexcel.version}</version>
- </dependency>
以上为父工程中dependencyManagement中依赖管理的版本。
二、core核心包中引入依赖
1、Commons Collections 提供操作list、map、set工具类
commons-collections4:依赖版本:4.4
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-collections4</artifactId>
- <version>4.4</version>
- </dependency>
2、HTTP MIME 提供上传、下载文件api,因为
httpmime :依赖版本 4.5.2
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpmime</artifactId>
- <version>4.5.2</version>
- </dependency>
3、Dom4j 开源 xml 解析包,jackson-dataformat-xml Jackson 处理 xml
dom4j: 依赖版本:1.6.1
jackson-dataformat-xml : 依赖版本同 fastjson
- <dependency>
- <groupId>dom4j</groupId>
- <artifactId>dom4j</artifactId>
- <version>${dom4j.version}</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.dataformat</groupId>
- <artifactId>jackson-dataformat-xml</artifactId>
- </dependency>
4、CXF cxf框架搭建webservice 对外接口服务
cxf-rt-transports-http: 依赖版本:3.3.6
cxf-rt-frontend-jaxws:依赖版本:3.4.0
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-frontend-jaxws</artifactId>
- <version>${cxf.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-transports-http</artifactId>
- <version>3.3.6</version>
- </dependency>
5、Kryo序列化
kryo : 依赖版本 4.0.2
kryo-serializers:依赖版本 0.44
- <dependency>
- <groupId>com.esotericsoftware</groupId>
- <artifactId>kryo</artifactId>
- <version>4.0.2</version>
- </dependency>
- <dependency>
- <groupId>de.javakaffee</groupId>
- <artifactId>kryo-serializers</artifactId>
- <version>0.44</version>
- </dependency>
6、spring-boot-configuration-processor 配置类生成元数据
spring-boot-configuration-processor 依赖版本 同springboot
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-configuration-processor</artifactId>
- <optional>true</optional>
- </dependency>
7、easypoi-spring-boot-starter poi接口基础上进行了封装
easypoi-spring-boot-starter:依赖版本 4.4.0
- <dependency>
- <groupId>cn.afterturn</groupId>
- <artifactId>easypoi-spring-boot-starter</artifactId>
- <version>${easypoi.version}</version>
- </dependency>
8、mybatis-plus-annotation 开启代码注释功能的依赖
mybatis-plus-annotation:依赖版本 同mp
- <dependency>
- <groupId>com.baomidou</groupId>
- <artifactId>mybatis-plus-annotation</artifactId>
- <version>${mybatis-plus-starter.version}</version>
- <scope>compile</scope>
- </dependency>
9、jackson-datatype-jsr310 jackson库的一个扩展
jackson-datatype-jsr310 :依赖版本 同jackson
- <dependency>
- <groupId>com.fasterxml.jackson.datatype</groupId>
- <artifactId>jackson-datatype-jsr310</artifactId>
- </dependency>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。