fix: Gateway不扫描fund-common避免依赖冲突

This commit is contained in:
zhangjf 2026-02-20 18:04:30 +08:00
parent ef46844bfd
commit 4af7d712cd
10 changed files with 58 additions and 16 deletions

View File

@ -1,4 +1,4 @@
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
#Tue Feb 17 19:14:24 CST 2026
#Fri Feb 20 17:27:25 CST 2026
fund-common-0.0.1-SNAPSHOT.jar>=
fund-common-0.0.1-SNAPSHOT.pom>=

View File

@ -50,6 +50,34 @@
<artifactId>jackson-databind</artifactId>
</dependency>
<!-- EasyExcel -->
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-spring-boot-starter</artifactId>
<version>4.4.0</version>
</dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<!-- Spring Cloud LoadBalancer (租户负载均衡) -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
</dependency>
<!-- MyBatis Plus (租户插件) -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-extension</artifactId>
<version>3.5.5</version>
<scope>provided</scope>
</dependency>
<!-- Test -->
<dependency>
<groupId>org.springframework.boot</groupId>

View File

@ -3,7 +3,7 @@
<groupId>com.fundplatform</groupId>
<artifactId>fund-common</artifactId>
<versioning>
<lastUpdated>20260217111414</lastUpdated>
<lastUpdated>20260220092715</lastUpdated>
<snapshot>
<localCopy>true</localCopy>
</snapshot>
@ -11,12 +11,12 @@
<snapshotVersion>
<extension>pom</extension>
<value>0.0.1-SNAPSHOT</value>
<updated>20260217111414</updated>
<updated>20260220092715</updated>
</snapshotVersion>
<snapshotVersion>
<extension>jar</extension>
<value>0.0.1-SNAPSHOT</value>
<updated>20260217111414</updated>
<updated>20260220092715</updated>
</snapshotVersion>
</snapshotVersions>
</versioning>

View File

@ -6,6 +6,6 @@
<versions>
<version>0.0.1-SNAPSHOT</version>
</versions>
<lastUpdated>20260217111414</lastUpdated>
<lastUpdated>20260220092715</lastUpdated>
</versioning>
</metadata>

View File

@ -1,3 +1,3 @@
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
#Tue Feb 17 19:14:15 CST 2026
#Fri Feb 20 17:13:04 CST 2026
fundplatform-0.0.1-SNAPSHOT.pom>=

View File

@ -60,6 +60,21 @@
</dependencies>
</dependencyManagement>
<!-- 公共依赖 - 所有模块都需要的依赖 -->
<dependencies>
<!-- Spring Boot Actuator - 健康检查和监控端点 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- Micrometer Prometheus - Prometheus 监控指标暴露 -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
</dependencies>
<!-- 项目内自定义 Maven 仓库配置,避免依赖外部 settings.xml 中的私服配置 -->
<repositories>
<!-- 官方中央仓库 -->

View File

@ -3,7 +3,7 @@
<groupId>com.fundplatform</groupId>
<artifactId>fundplatform</artifactId>
<versioning>
<lastUpdated>20260217111414</lastUpdated>
<lastUpdated>20260220091303</lastUpdated>
<snapshot>
<localCopy>true</localCopy>
</snapshot>
@ -11,7 +11,7 @@
<snapshotVersion>
<extension>pom</extension>
<value>0.0.1-SNAPSHOT</value>
<updated>20260217111414</updated>
<updated>20260220091303</updated>
</snapshotVersion>
</snapshotVersions>
</versioning>

View File

@ -6,6 +6,6 @@
<versions>
<version>0.0.1-SNAPSHOT</version>
</versions>
<lastUpdated>20260217111414</lastUpdated>
<lastUpdated>20260220091303</lastUpdated>
</versioning>
</metadata>

View File

@ -5,13 +5,12 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@SpringBootApplication(scanBasePackages = {
"com.fundplatform.gateway",
"com.fundplatform.common.auth", // TokenInfo
"com.fundplatform.common.context", // TraceContextHolder
"com.fundplatform.common.exception", // GlobalExceptionHandler
"com.fundplatform.common.result" // Result class
// 注意不扫描 common.cache (需要RedisTemplateGateway只有ReactiveRedisTemplate)
// 注意不扫描 common.web (使用Servlet APIGateway是WebFlux)
"com.fundplatform.gateway"
// 注意Gateway不扫描fund-common的任何包避免依赖冲突
// - common.auth: TokenService需要RedisService
// - common.cache: 需要非响应式RedisTemplate
// - common.nacos: 需要Registration bean
// - common.web: 使用Servlet API
})
@EnableDiscoveryClient
public class GatewayApplication {