当前位置:   article > 正文

项目所需依赖总结_springframework最新依赖

springframework最新依赖

1、核心依赖:

    spring-boot-dependencies:配置版本是2.6.14。
    spring-cloud-dependencies:配置版本是2021.0.3。
    spring-cloud-alibaba-dependencies:配置版本是1.4.2。
    需要在dependencyManagement中进行配置,配置步骤如下:

  1. <properties>
  2. <maven.compiler.source>8</maven.compiler.source>
  3. <maven.compiler.target>8</maven.compiler.target>
  4. <!-- 核心依赖 -->
  5. <spring-boot.version>2.6.14</spring-boot.version>
  6. <spring-cloud.version>2021.0.3</spring-cloud.version>
  7. <spring-cloud.alibaba.version>2021.1</spring-cloud.alibaba.version>
  8. </properties>
  9. <dependencyManagement>
  10. <dependencies>
  11. <dependency>
  12. <groupId>org.springframework.boot</groupId>
  13. <artifactId>spring-boot-dependencies</artifactId>
  14. <version>${spring-boot.version}</version>
  15. <type>pom</type>
  16. <scope>import</scope>
  17. </dependency>
  18. <dependency>
  19. <groupId>org.springframework.cloud</groupId>
  20. <artifactId>spring-cloud-dependencies</artifactId>
  21. <version>${spring-cloud.version}</version>
  22. <type>pom</type>
  23. <scope>import</scope>
  24. </dependency>
  25. <dependency>
  26. <groupId>org.springframework.cloud</groupId>
  27. <artifactId>spring-cloud-alibaba-dependencies</artifactId>
  28. <version>${spring-cloud.alibaba.version}</version>
  29. <type>pom</type>
  30. <scope>import</scope>
  31. </dependency>
  32. </dependencies>
  33. </dependencyManagement>

2、数据校验、全局异常拦截依赖
        spring-boot-starter-validation:版本与springboot版本一致:

  1. <dependency>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-starter-validation</artifactId>
  4. <version>${spring-boot.version}</version>
  5. </dependency>

3、nacos依赖
        nacos-client:nacos依赖 版本:2.1.0

  1. <dependency>
  2. <groupId>com.alibaba.nacos</groupId>
  3. <artifactId>nacos-client</artifactId>
  4. <version>${nacos.version}</version>
  5. </dependency>

4、redis依赖
      spring-boot-starter-data-redis:redis 依赖版本:同springboot

  1. <dependency>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-starter-data-redis</artifactId>
  4. <version>${spring-boot.version}</version>
  5. </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

  1. <dependency>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-starter-data-jdbc</artifactId>
  4. <version>${spring-boot.version}</version>
  5. </dependency>
  6. <dependency>
  7. <groupId>mysql</groupId>
  8. <artifactId>mysql-connector-java</artifactId>
  9. <version>${mysql-connector.version}</version>
  10. <scope>runtime</scope>
  11. </dependency>
  12. <dependency>
  13. <groupId>com.baomidou</groupId>
  14. <artifactId>mybatis-plus-boot-starter</artifactId>
  15. <version>${mybatis-plus-starter.version}</version>
  16. </dependency>
  17. <dependency>
  18. <groupId>com.baomidou</groupId>
  19. <artifactId>mybatis-plus-generator</artifactId>
  20. <version>${mybatis-plus-generator.version}</version>
  21. </dependency>
  22. <dependency>
  23. <groupId>com.baomidou</groupId>
  24. <artifactId>mybatis-plus-extension</artifactId>
  25. <version>${mybatis-plus-starter.version}</version>
  26. </dependency>
  27. <dependency>
  28. <groupId>com.github.jeffreyning</groupId>
  29. <artifactId>mybatisplus-plus</artifactId>
  30. <version>${jeffreyning.mybatisplus-plus.version}</version>
  31. </dependency>
<scope>runtime</scope> 代表测试和运行时需要。

6、fastjson JSON互转依赖;
        fastjson:配置版本是 1.2.83

  1. <dependency>
  2. <groupId>com.alibaba</groupId>
  3. <artifactId>fastjson</artifactId>
  4. <version>${fastjson.version}</version>
  5. </dependency>

7、http封装依赖:
        okhttp:配置版本是4.9.0
        httpclient:配置版本是:4.5.13

  1. <dependency>
  2. <groupId>com.squareup.okhttp3</groupId>
  3. <artifactId>okhttp</artifactId>
  4. <version>${okhttp3.version}</version>
  5. </dependency>
  6. <dependency>
  7. <groupId>org.apache.httpcomponents</groupId>
  8. <artifactId>httpclient</artifactId>
  9. <version>${httpclient.version}</version>
  10. </dependency>

8、hutool依赖、commons-lang3依赖,提供各种工具类:
     hutool-all:配置版本:5.7.12
     commons-lang3:配置版本:3.12.0

  1. <dependency>
  2. <groupId>cn.hutool</groupId>
  3. <artifactId>hutool-all</artifactId>
  4. <version>${hutool.version}</version>
  5. </dependency>
  6. <dependency>
  7. <groupId>org.apache.commons</groupId>
  8. <artifactId>commons-lang3</artifactId>
  9. <version>${commons-lang3.version}</version>
  10. </dependency>

         也可以选择引入hutool-bom:

  1. <dependency>
  2. <groupId>cn.hutool</groupId>
  3. <artifactId>hutool-bom</artifactId>
  4. <version>${hutool.version}</version>
  5. <type>pom</type>
  6. <scope>import</scope>
  7. </dependency>

all和bom区别如下:
        all将所有模块打包成一个jar,因此在你的项目中只有一个hutool-all的jar包,你也无法选择去除哪些模块。
        bom则是默认引入所有模块,你可以通过exclude标签排除不需要的模块,减少整个项目体积。

9、jsoup 爬虫工具类:
        jsoup:配置版本:1.13.1

  1. <dependency>
  2. <groupId>org.jsoup</groupId>
  3. <artifactId>jsoup</artifactId>
  4. <version>${jsoup.version}</version>
  5. </dependency>

10、gateway
        spring-cloud-starter-gateway:配置版本:3.0.7

  1. <dependency>
  2. <groupId>org.springframework.cloud</groupId>
  3. <artifactId>spring-cloud-starter-gateway</artifactId>
  4. <version>${gateway.version}</version>
  5. </dependency>

11、Quartz定时任务调度框架
        spring-boot-starter-quartz:配置版本同springboot

  1. <dependency>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-starter-quartz</artifactId>
  4. <version>${spring-boot.version}</version>
  5. </dependency>

12、模板引擎freemarker
        freemarker:依赖版本:2.3.30

  1. <dependency>
  2. <groupId>org.freemarker</groupId>
  3. <artifactId>freemarker</artifactId>
  4. <version>${freemarker.version}</version>
  5. </dependency>

13、Logback日志框架:
        logstash-logback-encoder: 依赖版本:7.2

  1. <dependency>
  2. <groupId>net.logstash.logback</groupId>
  3. <artifactId>logstash-logback-encoder</artifactId>
  4. <version>${logstash-logback-encoder.version}</version>
  5. </dependency>

14、poi-tl Word模板引擎
        poi-tl :依赖版本 1.10.5

  1. <dependency>
  2. <groupId>com.deepoove</groupId>
  3. <artifactId>poi-tl</artifactId>
  4. <version>${poi-tl.version}</version>
  5. </dependency>

15 、easyexcel
        easyexcel :依赖版本 3.2.1

  1. <dependency>
  2. <groupId>com.alibaba</groupId>
  3. <artifactId>easyexcel</artifactId>
  4. <version>${easyexcel.version}</version>
  5. </dependency>

以上为父工程中dependencyManagement中依赖管理的版本。

二、core核心包中引入依赖

1、Commons Collections 提供操作list、map、set工具类
        commons-collections4:依赖版本:4.4

  1. <dependency>
  2. <groupId>org.apache.commons</groupId>
  3. <artifactId>commons-collections4</artifactId>
  4. <version>4.4</version>
  5. </dependency>

2、HTTP MIME 提供上传、下载文件api,因为
        httpmime :依赖版本  4.5.2

  1. <dependency>
  2. <groupId>org.apache.httpcomponents</groupId>
  3. <artifactId>httpmime</artifactId>
  4. <version>4.5.2</version>
  5. </dependency>

3、Dom4j  开源 xml 解析包,jackson-dataformat-xml Jackson 处理 xml

        dom4j: 依赖版本:1.6.1
        jackson-dataformat-xml : 依赖版本同 fastjson

  1. <dependency>
  2. <groupId>dom4j</groupId>
  3. <artifactId>dom4j</artifactId>
  4. <version>${dom4j.version}</version>
  5. </dependency>
  6. <dependency>
  7. <groupId>com.fasterxml.jackson.dataformat</groupId>
  8. <artifactId>jackson-dataformat-xml</artifactId>
  9. </dependency>

4、CXF  cxf框架搭建webservice 对外接口服务
        cxf-rt-transports-http:  依赖版本:3.3.6
        cxf-rt-frontend-jaxws:依赖版本:3.4.0

  1. <dependency>
  2. <groupId>org.apache.cxf</groupId>
  3. <artifactId>cxf-rt-frontend-jaxws</artifactId>
  4. <version>${cxf.version}</version>
  5. </dependency>
  6. <dependency>
  7. <groupId>org.apache.cxf</groupId>
  8. <artifactId>cxf-rt-transports-http</artifactId>
  9. <version>3.3.6</version>
  10. </dependency>

5、Kryo序列化
        kryo : 依赖版本 4.0.2
        kryo-serializers:依赖版本 0.44

  1. <dependency>
  2. <groupId>com.esotericsoftware</groupId>
  3. <artifactId>kryo</artifactId>
  4. <version>4.0.2</version>
  5. </dependency>
  6. <dependency>
  7. <groupId>de.javakaffee</groupId>
  8. <artifactId>kryo-serializers</artifactId>
  9. <version>0.44</version>
  10. </dependency>

6、spring-boot-configuration-processor   配置类生成元数据
        spring-boot-configuration-processor 依赖版本 同springboot

  1. <dependency>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-configuration-processor</artifactId>
  4. <optional>true</optional>
  5. </dependency>

7、easypoi-spring-boot-starter poi接口基础上进行了封装
        easypoi-spring-boot-starter:依赖版本 4.4.0

  1. <dependency>
  2. <groupId>cn.afterturn</groupId>
  3. <artifactId>easypoi-spring-boot-starter</artifactId>
  4. <version>${easypoi.version}</version>
  5. </dependency>

8、mybatis-plus-annotation   开启代码注释功能的依赖
        mybatis-plus-annotation:依赖版本 同mp

  1. <dependency>
  2. <groupId>com.baomidou</groupId>
  3. <artifactId>mybatis-plus-annotation</artifactId>
  4. <version>${mybatis-plus-starter.version}</version>
  5. <scope>compile</scope>
  6. </dependency>

9、jackson-datatype-jsr310  jackson库的一个扩展
        jackson-datatype-jsr310 :依赖版本 同jackson

  1. <dependency>
  2. <groupId>com.fasterxml.jackson.datatype</groupId>
  3. <artifactId>jackson-datatype-jsr310</artifactId>
  4. </dependency>

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/327807?site
推荐阅读
相关标签
  

闽ICP备14008679号