320 lines
12 KiB
XML
320 lines
12 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||
<modelVersion>4.0.0</modelVersion>
|
||
<parent>
|
||
<groupId>org.xyzh</groupId>
|
||
<artifactId>urban-lifeline</artifactId>
|
||
<version>1.0.0</version>
|
||
</parent>
|
||
|
||
<groupId>org.xyzh</groupId>
|
||
<artifactId>gateway</artifactId>
|
||
<version>${urban-lifeline.version}</version>
|
||
|
||
<properties>
|
||
<maven.compiler.source>21</maven.compiler.source>
|
||
<maven.compiler.target>21</maven.compiler.target>
|
||
</properties>
|
||
|
||
<!-- Gateway 是 WebFlux 应用,必须排除所有 Servlet/Tomcat 相关依赖 -->
|
||
<dependencyManagement>
|
||
<dependencies>
|
||
<!-- 覆盖父 pom 继承的 spring-boot-starter-web,设为 test scope 使其不参与编译和运行 -->
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-web</artifactId>
|
||
<version>${spring-boot.version}</version>
|
||
<scope>test</scope>
|
||
<exclusions>
|
||
<exclusion>
|
||
<groupId>*</groupId>
|
||
<artifactId>*</artifactId>
|
||
</exclusion>
|
||
</exclusions>
|
||
</dependency>
|
||
<!-- 覆盖父 pom 继承的 spring-boot-starter-security -->
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-security</artifactId>
|
||
<version>${spring-boot.version}</version>
|
||
<scope>test</scope>
|
||
<exclusions>
|
||
<exclusion>
|
||
<groupId>*</groupId>
|
||
<artifactId>*</artifactId>
|
||
</exclusion>
|
||
</exclusions>
|
||
</dependency>
|
||
<!-- 覆盖父 pom 继承的 springdoc -->
|
||
<dependency>
|
||
<groupId>org.springdoc</groupId>
|
||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||
<version>${springdoc.version}</version>
|
||
<scope>test</scope>
|
||
<exclusions>
|
||
<exclusion>
|
||
<groupId>*</groupId>
|
||
<artifactId>*</artifactId>
|
||
</exclusion>
|
||
</exclusions>
|
||
</dependency>
|
||
<!-- 排除 Tomcat -->
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||
<version>${spring-boot.version}</version>
|
||
<scope>test</scope>
|
||
<exclusions>
|
||
<exclusion>
|
||
<groupId>*</groupId>
|
||
<artifactId>*</artifactId>
|
||
</exclusion>
|
||
</exclusions>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>org.apache.tomcat.embed</groupId>
|
||
<artifactId>tomcat-embed-core</artifactId>
|
||
<version>10.1.48</version>
|
||
<scope>test</scope>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>org.apache.tomcat.embed</groupId>
|
||
<artifactId>tomcat-embed-el</artifactId>
|
||
<version>10.1.48</version>
|
||
<scope>test</scope>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>org.apache.tomcat.embed</groupId>
|
||
<artifactId>tomcat-embed-websocket</artifactId>
|
||
<version>10.1.48</version>
|
||
<scope>test</scope>
|
||
</dependency>
|
||
<!-- 排除 spring-webmvc -->
|
||
<dependency>
|
||
<groupId>org.springframework</groupId>
|
||
<artifactId>spring-webmvc</artifactId>
|
||
<version>${spring-framework.version}</version>
|
||
<scope>test</scope>
|
||
</dependency>
|
||
</dependencies>
|
||
</dependencyManagement>
|
||
|
||
<dependencies>
|
||
<!-- Spring Cloud Gateway -->
|
||
<dependency>
|
||
<groupId>org.springframework.cloud</groupId>
|
||
<artifactId>spring-cloud-starter-gateway</artifactId>
|
||
<exclusions>
|
||
<exclusion>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-logging</artifactId>
|
||
</exclusion>
|
||
</exclusions>
|
||
</dependency>
|
||
|
||
<!-- Nacos 服务注册与发现 -->
|
||
<dependency>
|
||
<groupId>com.alibaba.cloud</groupId>
|
||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||
<exclusions>
|
||
<exclusion>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-logging</artifactId>
|
||
</exclusion>
|
||
<exclusion>
|
||
<groupId>com.alibaba.nacos</groupId>
|
||
<artifactId>nacos-logback-adapter-12</artifactId>
|
||
</exclusion>
|
||
<exclusion>
|
||
<groupId>com.alibaba.nacos</groupId>
|
||
<artifactId>logback-adapter</artifactId>
|
||
</exclusion>
|
||
</exclusions>
|
||
</dependency>
|
||
|
||
<!-- Nacos 配置中心 -->
|
||
<dependency>
|
||
<groupId>com.alibaba.cloud</groupId>
|
||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||
<exclusions>
|
||
<exclusion>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-logging</artifactId>
|
||
</exclusion>
|
||
<exclusion>
|
||
<groupId>com.alibaba.nacos</groupId>
|
||
<artifactId>nacos-logback-adapter-12</artifactId>
|
||
</exclusion>
|
||
<exclusion>
|
||
<groupId>com.alibaba.nacos</groupId>
|
||
<artifactId>logback-adapter</artifactId>
|
||
</exclusion>
|
||
</exclusions>
|
||
</dependency>
|
||
|
||
<!-- 负载均衡 -->
|
||
<dependency>
|
||
<groupId>org.springframework.cloud</groupId>
|
||
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
||
</dependency>
|
||
|
||
<!-- 认证模块(JWT验证) -->
|
||
<dependency>
|
||
<groupId>org.xyzh.common</groupId>
|
||
<artifactId>common-auth</artifactId>
|
||
<exclusions>
|
||
<!-- 排除Tomcat,Gateway必须使用Netty -->
|
||
<exclusion>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-web</artifactId>
|
||
</exclusion>
|
||
<exclusion>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||
</exclusion>
|
||
<exclusion>
|
||
<groupId>org.apache.tomcat.embed</groupId>
|
||
<artifactId>tomcat-embed-core</artifactId>
|
||
</exclusion>
|
||
</exclusions>
|
||
</dependency>
|
||
|
||
<!-- Redis(用于Token验证、限流等) -->
|
||
<dependency>
|
||
<groupId>org.xyzh.common</groupId>
|
||
<artifactId>common-redis</artifactId>
|
||
<exclusions>
|
||
<exclusion>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-web</artifactId>
|
||
</exclusion>
|
||
<exclusion>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||
</exclusion>
|
||
<exclusion>
|
||
<groupId>org.apache.tomcat.embed</groupId>
|
||
<artifactId>tomcat-embed-core</artifactId>
|
||
</exclusion>
|
||
</exclusions>
|
||
</dependency>
|
||
|
||
<!-- 工具类 -->
|
||
<!-- <dependency>
|
||
<groupId>org.xyzh.common</groupId>
|
||
<artifactId>common-utils</artifactId>
|
||
<exclusions>
|
||
<exclusion>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-web</artifactId>
|
||
</exclusion>
|
||
<exclusion>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||
</exclusion>
|
||
<exclusion>
|
||
<groupId>org.apache.tomcat.embed</groupId>
|
||
<artifactId>tomcat-embed-core</artifactId>
|
||
</exclusion>
|
||
</exclusions>
|
||
</dependency> -->
|
||
|
||
<!-- 核心模块 -->
|
||
<dependency>
|
||
<groupId>org.xyzh.common</groupId>
|
||
<artifactId>common-core</artifactId>
|
||
<exclusions>
|
||
<exclusion>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-web</artifactId>
|
||
</exclusion>
|
||
<exclusion>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||
</exclusion>
|
||
<exclusion>
|
||
<groupId>org.apache.tomcat.embed</groupId>
|
||
<artifactId>tomcat-embed-core</artifactId>
|
||
</exclusion>
|
||
</exclusions>
|
||
</dependency>
|
||
|
||
<!-- Spring Boot Actuator(健康检查) -->
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||
<exclusions>
|
||
<exclusion>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-logging</artifactId>
|
||
</exclusion>
|
||
</exclusions>
|
||
</dependency>
|
||
|
||
<!-- WebFlux(Gateway依赖) -->
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-webflux</artifactId>
|
||
</dependency>
|
||
|
||
<!-- 配置处理 -->
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||
<optional>true</optional>
|
||
</dependency>
|
||
|
||
<!-- FastJson -->
|
||
<dependency>
|
||
<groupId>com.alibaba.fastjson2</groupId>
|
||
<artifactId>fastjson2</artifactId>
|
||
</dependency>
|
||
|
||
<!-- Lombok -->
|
||
<dependency>
|
||
<groupId>org.projectlombok</groupId>
|
||
<artifactId>lombok</artifactId>
|
||
<optional>true</optional>
|
||
</dependency>
|
||
|
||
<!-- Gateway 需要 WebFlux 版本的 Spring Security -->
|
||
<dependency>
|
||
<groupId>org.springframework.security</groupId>
|
||
<artifactId>spring-security-config</artifactId>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>org.springframework.security</groupId>
|
||
<artifactId>spring-security-web</artifactId>
|
||
</dependency>
|
||
|
||
<!-- Servlet API (provided - 仅用于编译 common-auth 中的类,运行时不需要) -->
|
||
<dependency>
|
||
<groupId>jakarta.servlet</groupId>
|
||
<artifactId>jakarta.servlet-api</artifactId>
|
||
<scope>provided</scope>
|
||
</dependency>
|
||
|
||
<!-- Spring WebMVC (provided - 仅用于编译 common-auth/common-utils 中的类) -->
|
||
<dependency>
|
||
<groupId>org.springframework</groupId>
|
||
<artifactId>spring-webmvc</artifactId>
|
||
<scope>provided</scope>
|
||
</dependency>
|
||
</dependencies>
|
||
|
||
<build>
|
||
<finalName>${project.artifactId}</finalName>
|
||
<plugins>
|
||
<plugin>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||
<configuration>
|
||
<mainClass>org.xyzh.gateway.GatewayApplication</mainClass>
|
||
</configuration>
|
||
</plugin>
|
||
</plugins>
|
||
</build>
|
||
</project>
|