|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- <?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>
- <parent>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-parent</artifactId>
- <version>2.7.4</version>
- <relativePath/> <!-- lookup parent from repository -->
- </parent>
- <groupId>com.tuoheng.gateway</groupId>
- <artifactId>tuoheng_gateway</artifactId>
- <version>1.0.0</version>
- <name>tuoheng_gateway</name>
- <description>tuoheng_gateway</description>
- <properties>
- <java.version>1.8</java.version>
- <spring-cloud-alibaba.version>2021.0.1.0</spring-cloud-alibaba.version>
- </properties>
- <dependencies>
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-gateway</artifactId>
- <version>3.1.3</version>
- </dependency>
- <!-- <dependency>-->
- <!-- <groupId>org.springframework.cloud</groupId>-->
- <!-- <artifactId>spring-cloud-starter-consul-discovery</artifactId>-->
- <!-- <version>3.1.1</version>-->
- <!-- </dependency>-->
-
- <dependency>
- <groupId>com.auth0</groupId>
- <artifactId>java-jwt</artifactId>
- <version>3.10.0</version>
- </dependency>
-
- <dependency>
- <groupId>com.alibaba</groupId>
- <artifactId>fastjson</artifactId>
- <version>1.2.76</version>
- </dependency>
-
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-actuator</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
- <version>2.2.1.RELEASE</version>
- </dependency>
- <!-- 核心依赖,新版resource-->
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-test</artifactId>
- <scope>test</scope>
- </dependency>
-
- <!-- Spring Security Oauth2 依赖 -->
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-oauth2</artifactId>
- <!-- 此处需要加版本号 -->
- <version>2.2.5.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-security</artifactId>
- <!-- 此处需要加版本号 -->
- <version>2.1.4.RELEASE</version>
- </dependency>
-
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-test</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.projectlombok</groupId>
- <artifactId>lombok</artifactId>
- <version>1.18.22</version>
- </dependency>
-
- <!-- SpringCloud Alibaba Nacos -->
- <dependency>
- <groupId>com.alibaba.cloud</groupId>
- <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
- <version>${spring-cloud-alibaba.version}</version>
- <exclusions>
- <!-- 将ribbon排除 -->
- <exclusion>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <!--添加loadbalancer依赖
- 由于 Netflix Ribbon 进入停更维护阶段,因此 SpringCloud 2020.0.1 版本之后 删除了eureka中的ribbon,
- 替代ribbon的是spring cloud自带的LoadBalancer,默认使用的是轮询的方式
- 新版本的 Nacos discovery 都已经移除了 Ribbon ,此时我们需要引入 loadbalancer 代替,才能调用服务提供者提供的服务
- -->
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-loadbalancer</artifactId>
- <version>3.1.3</version>
- </dependency>
-
- <!-- SpringCloud Alibaba Nacos Config -->
- <dependency>
- <groupId>com.alibaba.cloud</groupId>
- <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
- <version>${spring-cloud-alibaba.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-bootstrap</artifactId>
- <version>3.0.3</version>
- </dependency>
-
- </dependencies>
-
- <!-- 构建环境变量 -->
- <profiles>
- <!-- 本地开发环境 -->
- <profile>
- <id>local</id>
- <properties>
- <package.environment>local</package.environment>
- </properties>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- </profile>
- <!-- 开发环境 -->
- <profile>
- <id>dev</id>
- <properties>
- <package.environment>dev</package.environment>
- </properties>
- </profile>
- <!-- 测试环境 -->
- <profile>
- <id>test</id>
- <properties>
- <package.environment>test</package.environment>
- </properties>
- </profile>
- <!-- 生产环境 -->
- <profile>
- <id>prod</id>
- <properties>
- <package.environment>prod</package.environment>
- </properties>
- </profile>
- </profiles>
-
- <!-- 构建环境配置 -->
- <build>
- <finalName>tuoheng_gateway</finalName>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- </resource>
-
- <resource>
- <directory>src/main/java</directory>
- <includes>
- <include>**/*.*</include>
- </includes>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
-
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- <targetPath>WEB-INF/classes</targetPath>
- <includes>
- <include>application-${package.environment}.yml</include>
- </includes>
- </resource>
- </resources>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- <version>2.1.11.RELEASE</version>
- <configuration>
- <finalName>${project.build.finalName}</finalName>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>repackage</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>repackage</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </project>
|