springboot的工程写业务领域最好提前准备的依赖我们在写业务领域代码的时候应该提前准备哪些依赖。这里做一个小范围的总结尽量全一点1.springboot-starter相关的依赖2.web相关的依赖3.连接mysql相关的依赖4.连接redis相关的依赖5.连接mq相关的依赖6.工具类相关的依赖谷歌的guavahutools7.方便开发相关的依赖devtoolslombok8.其他处理json相关的依赖明白了按你给出的分类顺序来组织一个不漏尽量全面。下面直接贴出可直接粘贴到pom.xml的依赖版本部分建议用属性统一管理这里给出具体版本示例。1. Spring Boot Starter 相关依赖这些是任何业务工程的基础骨架。!-- 核心 Starter包含自动配置、日志、yaml解析等 --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter/artifactId/dependency!-- 测试 Starter --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-test/artifactIdscopetest/scope/dependency!-- AOP Starter --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-aop/artifactId/dependency!-- 参数校验 Starter --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-validation/artifactId/dependency!-- 配置处理器写配置文件有提示 --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-configuration-processor/artifactIdoptionaltrue/optional/dependency!-- Actuator 监控 --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-actuator/artifactId/dependency2. Web 相关依赖!-- 提供 REST API、内嵌 Tomcat 等 --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-web/artifactId/dependency!-- WebSocket 支持如果需要长连接推送 --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-websocket/artifactId/dependency!-- 响应式 Web可选若需要 WebFlux --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-webflux/artifactId/dependency3. 连接 MySQL 相关依赖!-- MySQL 驱动 --dependencygroupIdmysql/groupIdartifactIdmysql-connector-java/artifactIdscoperuntime/scope/dependency!-- 常用 ORM 框架MyBatis-Plus推荐 --dependencygroupIdcom.baomidou/groupIdartifactIdmybatis-plus-boot-starter/artifactIdversion3.5.5/version/dependency!-- 连接池Druid可选自带连接监控 --dependencygroupIdcom.alibaba/groupIdartifactIddruid-spring-boot-starter/artifactIdversion1.2.20/version/dependency!-- 分页插件配合 MyBatis-Plus 时可不加自带分页 --!-- 纯 MyBatis 时可加 pagehelper --dependencygroupIdcom.github.pagehelper/groupIdartifactIdpagehelper-spring-boot-starter/artifactIdversion2.1.0/version/dependency4. 连接 Redis 相关依赖!-- Spring Data Redis Starter --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-data-redis/artifactId/dependency!-- 连接池必需否则单连接 --dependencygroupIdorg.apache.commons/groupIdartifactIdcommons-pool2/artifactId/dependency!-- 如果需要分布式锁可加 Redisson功能更丰富 --dependencygroupIdorg.redisson/groupIdartifactIdredisson-spring-boot-starter/artifactIdversion3.27.2/version/dependency5. 连接 MQ 相关依赖按实际中间件选择!-- RabbitMQ --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-amqp/artifactId/dependency!-- Kafka --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-kafka/artifactId/dependency!-- RocketMQ第三方 --dependencygroupIdorg.apache.rocketmq/groupIdartifactIdrocketmq-spring-boot-starter/artifactIdversion2.2.3/version/dependency6. 工具类相关依赖!-- Google Guava --dependencygroupIdcom.google.guava/groupIdartifactIdguava/artifactIdversion33.0.0-jre/version/dependency!-- HuTool国产大而全 --dependencygroupIdcn.hutool/groupIdartifactIdhutool-all/artifactIdversion5.8.26/version/dependency!-- Apache Commons 常用三件套 --dependencygroupIdorg.apache.commons/groupIdartifactIdcommons-lang3/artifactId/dependencydependencygroupIdorg.apache.commons/groupIdartifactIdcommons-collections4/artifactIdversion4.4/version/dependencydependencygroupIdcommons-io/groupIdartifactIdcommons-io/artifactIdversion2.15.1/version/dependency!-- 对象属性拷贝MapStruct结合 Lombok 更好 --dependencygroupIdorg.mapstruct/groupIdartifactIdmapstruct/artifactIdversion1.5.5.Final/version/dependencydependencygroupIdorg.mapstruct/groupIdartifactIdmapstruct-processor/artifactIdversion1.5.5.Final/versionscopeprovided/scope/dependency7. 方便开发相关的依赖!-- 热部署 devtools只生效于开发环境 --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-devtools/artifactIdscoperuntime/scopeoptionaltrue/optional/dependency!-- Lombok简化 POJO、日志等 --dependencygroupIdorg.projectlombok/groupIdartifactIdlombok/artifactIdscopeprovided/scope/dependency!-- 方便编写单元测试时生成测试数据如 Java Faker --dependencygroupIdcom.github.javafaker/groupIdartifactIdjavafaker/artifactIdversion1.0.2/versionscopetest/scope/dependency8. 其他处理 JSON 相关的依赖Spring Boot Web 默认已内置 Jackson一般不需要额外加。若需要其他 JSON 库!-- Gson --dependencygroupIdcom.google.code.gson/groupIdartifactIdgson/artifactId/dependency!-- Fastjson2较安全推荐使用 2.x --dependencygroupIdcom.alibaba.fastjson2/groupIdartifactIdfastjson2/artifactIdversion2.0.43/version/dependency!-- JSON 指针或 JSON Schema 等高级操作可选 --dependencygroupIdcom.jayway.jsonpath/groupIdartifactIdjson-path/artifactId/dependency!-- XML 与 JSON 互转如 XStream --dependencygroupIdcom.thoughtworks.xstream/groupIdartifactIdxstream/artifactIdversion1.4.20/version/dependency补充说明以上依赖中未标注版本号的部分由spring-boot-starter-parent统一管理版本无需填写。标注了version的属于第三方库建议在properties或dependencyManagement中统一版本。生产环境中按需裁剪例如只选一种 MQ、一种 JSON 库不要全部引入。如果需要分布式事务、定时任务、工作流等更专业的领域属于“业务领域特定依赖”未包含在此基础清单中。
springboot的工程,写业务领域最好提前准备的依赖
springboot的工程写业务领域最好提前准备的依赖我们在写业务领域代码的时候应该提前准备哪些依赖。这里做一个小范围的总结尽量全一点1.springboot-starter相关的依赖2.web相关的依赖3.连接mysql相关的依赖4.连接redis相关的依赖5.连接mq相关的依赖6.工具类相关的依赖谷歌的guavahutools7.方便开发相关的依赖devtoolslombok8.其他处理json相关的依赖明白了按你给出的分类顺序来组织一个不漏尽量全面。下面直接贴出可直接粘贴到pom.xml的依赖版本部分建议用属性统一管理这里给出具体版本示例。1. Spring Boot Starter 相关依赖这些是任何业务工程的基础骨架。!-- 核心 Starter包含自动配置、日志、yaml解析等 --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter/artifactId/dependency!-- 测试 Starter --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-test/artifactIdscopetest/scope/dependency!-- AOP Starter --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-aop/artifactId/dependency!-- 参数校验 Starter --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-validation/artifactId/dependency!-- 配置处理器写配置文件有提示 --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-configuration-processor/artifactIdoptionaltrue/optional/dependency!-- Actuator 监控 --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-actuator/artifactId/dependency2. Web 相关依赖!-- 提供 REST API、内嵌 Tomcat 等 --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-web/artifactId/dependency!-- WebSocket 支持如果需要长连接推送 --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-websocket/artifactId/dependency!-- 响应式 Web可选若需要 WebFlux --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-webflux/artifactId/dependency3. 连接 MySQL 相关依赖!-- MySQL 驱动 --dependencygroupIdmysql/groupIdartifactIdmysql-connector-java/artifactIdscoperuntime/scope/dependency!-- 常用 ORM 框架MyBatis-Plus推荐 --dependencygroupIdcom.baomidou/groupIdartifactIdmybatis-plus-boot-starter/artifactIdversion3.5.5/version/dependency!-- 连接池Druid可选自带连接监控 --dependencygroupIdcom.alibaba/groupIdartifactIddruid-spring-boot-starter/artifactIdversion1.2.20/version/dependency!-- 分页插件配合 MyBatis-Plus 时可不加自带分页 --!-- 纯 MyBatis 时可加 pagehelper --dependencygroupIdcom.github.pagehelper/groupIdartifactIdpagehelper-spring-boot-starter/artifactIdversion2.1.0/version/dependency4. 连接 Redis 相关依赖!-- Spring Data Redis Starter --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-data-redis/artifactId/dependency!-- 连接池必需否则单连接 --dependencygroupIdorg.apache.commons/groupIdartifactIdcommons-pool2/artifactId/dependency!-- 如果需要分布式锁可加 Redisson功能更丰富 --dependencygroupIdorg.redisson/groupIdartifactIdredisson-spring-boot-starter/artifactIdversion3.27.2/version/dependency5. 连接 MQ 相关依赖按实际中间件选择!-- RabbitMQ --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-amqp/artifactId/dependency!-- Kafka --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-kafka/artifactId/dependency!-- RocketMQ第三方 --dependencygroupIdorg.apache.rocketmq/groupIdartifactIdrocketmq-spring-boot-starter/artifactIdversion2.2.3/version/dependency6. 工具类相关依赖!-- Google Guava --dependencygroupIdcom.google.guava/groupIdartifactIdguava/artifactIdversion33.0.0-jre/version/dependency!-- HuTool国产大而全 --dependencygroupIdcn.hutool/groupIdartifactIdhutool-all/artifactIdversion5.8.26/version/dependency!-- Apache Commons 常用三件套 --dependencygroupIdorg.apache.commons/groupIdartifactIdcommons-lang3/artifactId/dependencydependencygroupIdorg.apache.commons/groupIdartifactIdcommons-collections4/artifactIdversion4.4/version/dependencydependencygroupIdcommons-io/groupIdartifactIdcommons-io/artifactIdversion2.15.1/version/dependency!-- 对象属性拷贝MapStruct结合 Lombok 更好 --dependencygroupIdorg.mapstruct/groupIdartifactIdmapstruct/artifactIdversion1.5.5.Final/version/dependencydependencygroupIdorg.mapstruct/groupIdartifactIdmapstruct-processor/artifactIdversion1.5.5.Final/versionscopeprovided/scope/dependency7. 方便开发相关的依赖!-- 热部署 devtools只生效于开发环境 --dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-devtools/artifactIdscoperuntime/scopeoptionaltrue/optional/dependency!-- Lombok简化 POJO、日志等 --dependencygroupIdorg.projectlombok/groupIdartifactIdlombok/artifactIdscopeprovided/scope/dependency!-- 方便编写单元测试时生成测试数据如 Java Faker --dependencygroupIdcom.github.javafaker/groupIdartifactIdjavafaker/artifactIdversion1.0.2/versionscopetest/scope/dependency8. 其他处理 JSON 相关的依赖Spring Boot Web 默认已内置 Jackson一般不需要额外加。若需要其他 JSON 库!-- Gson --dependencygroupIdcom.google.code.gson/groupIdartifactIdgson/artifactId/dependency!-- Fastjson2较安全推荐使用 2.x --dependencygroupIdcom.alibaba.fastjson2/groupIdartifactIdfastjson2/artifactIdversion2.0.43/version/dependency!-- JSON 指针或 JSON Schema 等高级操作可选 --dependencygroupIdcom.jayway.jsonpath/groupIdartifactIdjson-path/artifactId/dependency!-- XML 与 JSON 互转如 XStream --dependencygroupIdcom.thoughtworks.xstream/groupIdartifactIdxstream/artifactIdversion1.4.20/version/dependency补充说明以上依赖中未标注版本号的部分由spring-boot-starter-parent统一管理版本无需填写。标注了version的属于第三方库建议在properties或dependencyManagement中统一版本。生产环境中按需裁剪例如只选一种 MQ、一种 JSON 库不要全部引入。如果需要分布式事务、定时任务、工作流等更专业的领域属于“业务领域特定依赖”未包含在此基础清单中。