- 引入 MinIO 官方 Java SDK,替代 aliyun OSS SDK 处理与 MinIO 的交互 - 兼容 MinIO 的 AWS4-HMAC-SHA256 签名及 path-style 访问 - 区分上传和删除操作中 MinIO 与阿里云 OSS 的客户端实例创建及调用 - 统一文件路径处理,调整图片处理策略以兼容 MinIO 不支持的参数 - 增加对 MinIO 客户端异常的捕获与兼容处理 - 在 pom.xml 中添加对 okhttp 和 okio 依赖的版本锁定,解决版本冲突问题
426 lines
13 KiB
XML
426 lines
13 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||
<modelVersion>4.0.0</modelVersion>
|
||
|
||
<groupId>com.gxwebsoft</groupId>
|
||
<artifactId>server-api</artifactId>
|
||
<version>1.0</version>
|
||
|
||
<name>server-api</name>
|
||
<description>WebSoftApi project for Spring Boot</description>
|
||
|
||
<parent>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-parent</artifactId>
|
||
<!-- 保持 Spring Boot 2.5.x 系列,升级到最新的安全版本 -->
|
||
<version>2.5.15</version>
|
||
<relativePath/> <!-- lookup parent from repository -->
|
||
</parent>
|
||
|
||
<properties>
|
||
<java.version>17</java.version>
|
||
<maven.compiler.source>17</maven.compiler.source>
|
||
<maven.compiler.target>17</maven.compiler.target>
|
||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||
</properties>
|
||
|
||
<dependencyManagement>
|
||
<dependencies>
|
||
<!-- 强制 okhttp/okio 版本,避免 minio-java(要求 okhttp>=4.11.0) 与微信/支付 SDK 引入的 okhttp3 旧版冲突 -->
|
||
<dependency>
|
||
<groupId>com.squareup.okhttp3</groupId>
|
||
<artifactId>okhttp</artifactId>
|
||
<version>4.12.0</version>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>com.squareup.okio</groupId>
|
||
<artifactId>okio</artifactId>
|
||
<version>3.6.0</version>
|
||
</dependency>
|
||
</dependencies>
|
||
</dependencyManagement>
|
||
|
||
<dependencies>
|
||
<!-- 强制 okhttp 4.12.0:minio-java 要求 okhttp>=4.11.0,放在 dependencies 首位确保胜出,
|
||
避免运行时 NoSuchMethodError(okhttp3.RequestBody.create 等) -->
|
||
<dependency>
|
||
<groupId>com.squareup.okhttp3</groupId>
|
||
<artifactId>okhttp</artifactId>
|
||
<version>4.12.0</version>
|
||
</dependency>
|
||
|
||
<!-- spring-boot-devtools -->
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-devtools</artifactId>
|
||
<scope>runtime</scope>
|
||
<optional>true</optional>
|
||
</dependency>
|
||
|
||
<!-- spring-boot-test -->
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-test</artifactId>
|
||
<scope>test</scope>
|
||
</dependency>
|
||
|
||
<!-- spring-boot-web -->
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-web</artifactId>
|
||
</dependency>
|
||
|
||
<!-- jackson-datatype-jsr310 for Java 8 time support -->
|
||
<dependency>
|
||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||
</dependency>
|
||
|
||
<!-- spring-boot-aop -->
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-aop</artifactId>
|
||
</dependency>
|
||
|
||
<!-- spring-boot-configuration-processor -->
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||
<optional>true</optional>
|
||
</dependency>
|
||
|
||
<!-- lombok -->
|
||
<dependency>
|
||
<groupId>org.projectlombok</groupId>
|
||
<artifactId>lombok</artifactId>
|
||
<optional>true</optional>
|
||
</dependency>
|
||
|
||
<!-- mysql - 升级到安全版本,修复 CVE-2023-22102 -->
|
||
<dependency>
|
||
<groupId>com.mysql</groupId>
|
||
<artifactId>mysql-connector-j</artifactId>
|
||
<version>8.2.0</version>
|
||
<scope>runtime</scope>
|
||
</dependency>
|
||
|
||
<!-- druid - 升级到最新稳定版本 -->
|
||
<dependency>
|
||
<groupId>com.alibaba</groupId>
|
||
<artifactId>druid-spring-boot-starter</artifactId>
|
||
<version>1.2.20</version>
|
||
</dependency>
|
||
|
||
<!-- mybatis-plus -->
|
||
<dependency>
|
||
<groupId>com.baomidou</groupId>
|
||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||
<version>3.4.3.3</version>
|
||
</dependency>
|
||
|
||
<!-- mybatis-plus 连表插件-->
|
||
<dependency>
|
||
<groupId>com.github.yulichang</groupId>
|
||
<artifactId>mybatis-plus-join-boot-starter</artifactId>
|
||
<version>1.4.5</version>
|
||
</dependency>
|
||
|
||
<!-- mybatis-plus-generator -->
|
||
<dependency>
|
||
<groupId>com.baomidou</groupId>
|
||
<artifactId>mybatis-plus-generator</artifactId>
|
||
<version>3.4.1</version>
|
||
</dependency>
|
||
|
||
<!-- hutool - 升级到安全版本 -->
|
||
<dependency>
|
||
<groupId>cn.hutool</groupId>
|
||
<artifactId>hutool-core</artifactId>
|
||
<version>5.8.25</version>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>cn.hutool</groupId>
|
||
<artifactId>hutool-extra</artifactId>
|
||
<version>5.8.25</version>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>cn.hutool</groupId>
|
||
<artifactId>hutool-http</artifactId>
|
||
<version>5.8.25</version>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>cn.hutool</groupId>
|
||
<artifactId>hutool-crypto</artifactId>
|
||
<version>5.8.25</version>
|
||
</dependency>
|
||
|
||
<!-- easy poi -->
|
||
<dependency>
|
||
<groupId>cn.afterturn</groupId>
|
||
<artifactId>easypoi-base</artifactId>
|
||
<version>4.4.0</version>
|
||
</dependency>
|
||
|
||
<!-- tika, 用于FileServer获取content-type - 升级到安全版本 -->
|
||
<dependency>
|
||
<groupId>org.apache.tika</groupId>
|
||
<artifactId>tika-core</artifactId>
|
||
<version>2.9.1</version>
|
||
</dependency>
|
||
|
||
<!-- open office, 用于文档转pdf实现在线预览 -->
|
||
<dependency>
|
||
<groupId>com.github.livesense</groupId>
|
||
<artifactId>jodconverter-core</artifactId>
|
||
<version>1.0.5</version>
|
||
</dependency>
|
||
|
||
<!-- spring-boot-mail -->
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-mail</artifactId>
|
||
</dependency>
|
||
|
||
<!-- 模板引擎, 用于邮件、代码生成等 - 升级到安全版本 -->
|
||
<dependency>
|
||
<groupId>com.ibeetl</groupId>
|
||
<artifactId>beetl</artifactId>
|
||
<version>3.15.10.RELEASE</version>
|
||
</dependency>
|
||
|
||
<!-- swagger - 保持原有版本,确保兼容性 -->
|
||
<dependency>
|
||
<groupId>io.springfox</groupId>
|
||
<artifactId>springfox-boot-starter</artifactId>
|
||
<version>3.0.0</version>
|
||
</dependency>
|
||
|
||
<!-- spring security -->
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-security</artifactId>
|
||
</dependency>
|
||
|
||
<!-- jjwt - 升级到安全版本 -->
|
||
<dependency>
|
||
<groupId>io.jsonwebtoken</groupId>
|
||
<artifactId>jjwt-api</artifactId>
|
||
<version>0.11.5</version>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>io.jsonwebtoken</groupId>
|
||
<artifactId>jjwt-impl</artifactId>
|
||
<version>0.11.5</version>
|
||
<scope>runtime</scope>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>io.jsonwebtoken</groupId>
|
||
<artifactId>jjwt-jackson</artifactId>
|
||
<version>0.11.5</version>
|
||
<scope>runtime</scope>
|
||
</dependency>
|
||
|
||
<!-- 图形验证码 -->
|
||
<dependency>
|
||
<groupId>com.github.whvcse</groupId>
|
||
<artifactId>easy-captcha</artifactId>
|
||
<version>1.6.2</version>
|
||
</dependency>
|
||
|
||
<!--Redis-->
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||
</dependency>
|
||
|
||
<!-- spring-boot-actuator -->
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||
</dependency>
|
||
|
||
<!-- 阿里SDK -->
|
||
<dependency>
|
||
<groupId>com.aliyun</groupId>
|
||
<artifactId>aliyun-java-sdk-core</artifactId>
|
||
<version>4.4.3</version>
|
||
</dependency>
|
||
<!--阿里支付 老版本 SDK-->
|
||
<dependency>
|
||
<groupId>com.alipay.sdk</groupId>
|
||
<artifactId>alipay-sdk-java</artifactId>
|
||
<version>4.35.0.ALL</version>
|
||
</dependency>
|
||
<!-- 升级 BouncyCastle 到安全版本 -->
|
||
<dependency>
|
||
<groupId>org.bouncycastle</groupId>
|
||
<artifactId>bcprov-jdk18on</artifactId>
|
||
<version>1.77</version>
|
||
</dependency>
|
||
<!-- commons-logging - 升级到安全版本 -->
|
||
<dependency>
|
||
<groupId>commons-logging</groupId>
|
||
<artifactId>commons-logging</artifactId>
|
||
<version>1.3.0</version>
|
||
</dependency>
|
||
<!-- fastjson - 升级到安全版本 -->
|
||
<dependency>
|
||
<groupId>com.alibaba</groupId>
|
||
<artifactId>fastjson</artifactId>
|
||
<version>2.0.43</version>
|
||
</dependency>
|
||
|
||
<!--二维码 - 升级版本-->
|
||
<dependency>
|
||
<groupId>com.google.zxing</groupId>
|
||
<artifactId>core</artifactId>
|
||
<version>3.5.2</version>
|
||
</dependency>
|
||
|
||
<!-- gson - 升级到安全版本 -->
|
||
<dependency>
|
||
<groupId>com.google.code.gson</groupId>
|
||
<artifactId>gson</artifactId>
|
||
<version>2.10.1</version>
|
||
</dependency>
|
||
|
||
<dependency>
|
||
<groupId>com.vaadin.external.google</groupId>
|
||
<artifactId>android-json</artifactId>
|
||
<version>0.0.20131108.vaadin1</version>
|
||
<scope>compile</scope>
|
||
</dependency>
|
||
|
||
<!-- socketio - 升级版本 -->
|
||
<dependency>
|
||
<groupId>com.corundumstudio.socketio</groupId>
|
||
<artifactId>netty-socketio</artifactId>
|
||
<version>2.0.3</version>
|
||
</dependency>
|
||
|
||
<!-- 微信支付 APIv3 Java SDK - 升级到安全版本 -->
|
||
<dependency>
|
||
<groupId>com.github.wechatpay-apiv3</groupId>
|
||
<artifactId>wechatpay-java</artifactId>
|
||
<version>0.2.17</version>
|
||
</dependency>
|
||
|
||
<!-- 微信小程序 SDK - 升级版本 -->
|
||
<dependency>
|
||
<groupId>com.github.binarywang</groupId>
|
||
<artifactId>weixin-java-miniapp</artifactId>
|
||
<version>4.6.0</version>
|
||
</dependency>
|
||
|
||
<!-- 阿里云 OSS - 升级到安全版本 -->
|
||
<dependency>
|
||
<groupId>com.aliyun.oss</groupId>
|
||
<artifactId>aliyun-sdk-oss</artifactId>
|
||
<version>3.17.4</version>
|
||
</dependency>
|
||
|
||
<!-- MinIO 官方 Java SDK:用于对接 MinIO 兼容 S3 存储。
|
||
注意 aliyun OSS SDK 无 AWS4-HMAC-SHA256 签名器,无法对接 MinIO,故 minio 分支单独用此 SDK。 -->
|
||
<dependency>
|
||
<groupId>io.minio</groupId>
|
||
<artifactId>minio</artifactId>
|
||
<version>8.5.7</version>
|
||
</dependency>
|
||
|
||
<!-- 阿里云 内容安全审核 -->
|
||
<dependency>
|
||
<groupId>com.aliyun</groupId>
|
||
<artifactId>green20220302</artifactId>
|
||
<version>1.0.8</version>
|
||
</dependency>
|
||
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-freemarker</artifactId>
|
||
</dependency>
|
||
|
||
<!-- 个推推送 SDK -->
|
||
<dependency>
|
||
<groupId>com.getui.push</groupId>
|
||
<artifactId>restful-sdk</artifactId>
|
||
<version>1.0.0.14</version>
|
||
</dependency>
|
||
|
||
<!-- spring-boot-starter-amqp for RabbitMQ -->
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-amqp</artifactId>
|
||
</dependency>
|
||
|
||
<!-- javax.annotation-api for Java 9+ compatibility (previously included in JDK) -->
|
||
<dependency>
|
||
<groupId>javax.annotation</groupId>
|
||
<artifactId>javax.annotation-api</artifactId>
|
||
<version>1.3.2</version>
|
||
</dependency>
|
||
|
||
<!-- knife4j - 升级到兼容版本 -->
|
||
<dependency>
|
||
<groupId>com.github.xiaoymin</groupId>
|
||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||
<version>3.0.3</version>
|
||
</dependency>
|
||
|
||
</dependencies>
|
||
|
||
<build>
|
||
<resources>
|
||
<resource>
|
||
<directory>src/main/java</directory>
|
||
<includes>
|
||
<include>**/*Mapper.xml</include>
|
||
</includes>
|
||
</resource>
|
||
<resource>
|
||
<directory>src/main/resources</directory>
|
||
<includes>
|
||
<include>**</include>
|
||
</includes>
|
||
</resource>
|
||
</resources>
|
||
<plugins>
|
||
<plugin>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||
<version>2.5.15</version>
|
||
<configuration>
|
||
<excludes>
|
||
<exclude>
|
||
<groupId>org.projectlombok</groupId>
|
||
<artifactId>lombok</artifactId>
|
||
</exclude>
|
||
</excludes>
|
||
</configuration>
|
||
</plugin>
|
||
<plugin>
|
||
<groupId>org.apache.maven.plugins</groupId>
|
||
<artifactId>maven-compiler-plugin</artifactId>
|
||
<configuration>
|
||
<source>17</source>
|
||
<target>17</target>
|
||
</configuration>
|
||
</plugin>
|
||
</plugins>
|
||
</build>
|
||
|
||
<repositories>
|
||
<repository>
|
||
<id>aliYunMaven</id>
|
||
<url>https://maven.aliyun.com/repository/public</url>
|
||
</repository>
|
||
<repository>
|
||
<id>com.e-iceblue</id>
|
||
<name>e-iceblue</name>
|
||
<url>https://repo.e-iceblue.cn/repository/maven-public/</url>
|
||
</repository>
|
||
</repositories>
|
||
|
||
</project>
|