拓恒统一网关服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pom.xml 8.1KB

2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  4. <modelVersion>4.0.0</modelVersion>
  5. <parent>
  6. <groupId>org.springframework.boot</groupId>
  7. <artifactId>spring-boot-starter-parent</artifactId>
  8. <version>2.7.4</version>
  9. <relativePath/> <!-- lookup parent from repository -->
  10. </parent>
  11. <groupId>com.tuoheng.gateway</groupId>
  12. <artifactId>tuoheng_gateway</artifactId>
  13. <version>1.0.0</version>
  14. <name>tuoheng_gateway</name>
  15. <description>tuoheng_gateway</description>
  16. <properties>
  17. <java.version>1.8</java.version>
  18. <spring-cloud-alibaba.version>2021.0.1.0</spring-cloud-alibaba.version>
  19. </properties>
  20. <dependencies>
  21. <dependency>
  22. <groupId>org.springframework.cloud</groupId>
  23. <artifactId>spring-cloud-starter-gateway</artifactId>
  24. <version>3.1.3</version>
  25. </dependency>
  26. <!-- <dependency>-->
  27. <!-- <groupId>org.springframework.cloud</groupId>-->
  28. <!-- <artifactId>spring-cloud-starter-consul-discovery</artifactId>-->
  29. <!-- <version>3.1.1</version>-->
  30. <!-- </dependency>-->
  31. <dependency>
  32. <groupId>com.auth0</groupId>
  33. <artifactId>java-jwt</artifactId>
  34. <version>3.10.0</version>
  35. </dependency>
  36. <dependency>
  37. <groupId>com.alibaba</groupId>
  38. <artifactId>fastjson</artifactId>
  39. <version>1.2.76</version>
  40. </dependency>
  41. <dependency>
  42. <groupId>org.springframework.boot</groupId>
  43. <artifactId>spring-boot-starter-actuator</artifactId>
  44. </dependency>
  45. <dependency>
  46. <groupId>org.springframework.cloud</groupId>
  47. <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
  48. <version>2.2.1.RELEASE</version>
  49. </dependency>
  50. <!-- 核心依赖,新版resource-->
  51. <dependency>
  52. <groupId>org.springframework.boot</groupId>
  53. <artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
  54. </dependency>
  55. <dependency>
  56. <groupId>org.springframework.boot</groupId>
  57. <artifactId>spring-boot-starter-test</artifactId>
  58. <scope>test</scope>
  59. </dependency>
  60. <!-- Spring Security Oauth2 依赖 -->
  61. <dependency>
  62. <groupId>org.springframework.cloud</groupId>
  63. <artifactId>spring-cloud-starter-oauth2</artifactId>
  64. <!-- 此处需要加版本号 -->
  65. <version>2.2.5.RELEASE</version>
  66. </dependency>
  67. <dependency>
  68. <groupId>org.springframework.cloud</groupId>
  69. <artifactId>spring-cloud-starter-security</artifactId>
  70. <!-- 此处需要加版本号 -->
  71. <version>2.1.4.RELEASE</version>
  72. </dependency>
  73. <dependency>
  74. <groupId>org.springframework.security</groupId>
  75. <artifactId>spring-security-test</artifactId>
  76. <scope>test</scope>
  77. </dependency>
  78. <dependency>
  79. <groupId>org.projectlombok</groupId>
  80. <artifactId>lombok</artifactId>
  81. <version>1.18.22</version>
  82. </dependency>
  83. <!-- SpringCloud Alibaba Nacos -->
  84. <dependency>
  85. <groupId>com.alibaba.cloud</groupId>
  86. <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
  87. <version>${spring-cloud-alibaba.version}</version>
  88. <exclusions>
  89. <!-- 将ribbon排除 -->
  90. <exclusion>
  91. <groupId>org.springframework.cloud</groupId>
  92. <artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
  93. </exclusion>
  94. </exclusions>
  95. </dependency>
  96. <!--添加loadbalancer依赖
  97. 由于 Netflix Ribbon 进入停更维护阶段,因此 SpringCloud 2020.0.1 版本之后 删除了eureka中的ribbon,
  98. 替代ribbon的是spring cloud自带的LoadBalancer,默认使用的是轮询的方式
  99. 新版本的 Nacos discovery 都已经移除了 Ribbon ,此时我们需要引入 loadbalancer 代替,才能调用服务提供者提供的服务
  100. -->
  101. <dependency>
  102. <groupId>org.springframework.cloud</groupId>
  103. <artifactId>spring-cloud-starter-loadbalancer</artifactId>
  104. <version>3.1.3</version>
  105. </dependency>
  106. <!-- SpringCloud Alibaba Nacos Config -->
  107. <dependency>
  108. <groupId>com.alibaba.cloud</groupId>
  109. <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
  110. <version>${spring-cloud-alibaba.version}</version>
  111. </dependency>
  112. <dependency>
  113. <groupId>org.springframework.cloud</groupId>
  114. <artifactId>spring-cloud-starter-bootstrap</artifactId>
  115. <version>3.0.3</version>
  116. </dependency>
  117. </dependencies>
  118. <!-- 构建环境变量 -->
  119. <profiles>
  120. <!-- 本地开发环境 -->
  121. <profile>
  122. <id>local</id>
  123. <properties>
  124. <package.environment>local</package.environment>
  125. </properties>
  126. <activation>
  127. <activeByDefault>true</activeByDefault>
  128. </activation>
  129. </profile>
  130. <!-- 开发环境 -->
  131. <profile>
  132. <id>dev</id>
  133. <properties>
  134. <package.environment>dev</package.environment>
  135. </properties>
  136. </profile>
  137. <!-- 测试环境 -->
  138. <profile>
  139. <id>test</id>
  140. <properties>
  141. <package.environment>test</package.environment>
  142. </properties>
  143. </profile>
  144. <!-- 生产环境 -->
  145. <profile>
  146. <id>prod</id>
  147. <properties>
  148. <package.environment>prod</package.environment>
  149. </properties>
  150. </profile>
  151. </profiles>
  152. <!-- 构建环境配置 -->
  153. <build>
  154. <finalName>tuoheng_gateway</finalName>
  155. <resources>
  156. <resource>
  157. <directory>src/main/resources</directory>
  158. <filtering>true</filtering>
  159. </resource>
  160. <resource>
  161. <directory>src/main/java</directory>
  162. <includes>
  163. <include>**/*.*</include>
  164. </includes>
  165. <excludes>
  166. <exclude>**/*.java</exclude>
  167. </excludes>
  168. </resource>
  169. <resource>
  170. <directory>src/main/resources</directory>
  171. <filtering>true</filtering>
  172. <targetPath>WEB-INF/classes</targetPath>
  173. <includes>
  174. <include>application-${package.environment}.yml</include>
  175. </includes>
  176. </resource>
  177. </resources>
  178. <pluginManagement>
  179. <plugins>
  180. <plugin>
  181. <groupId>org.springframework.boot</groupId>
  182. <artifactId>spring-boot-maven-plugin</artifactId>
  183. <version>2.1.11.RELEASE</version>
  184. <configuration>
  185. <finalName>${project.build.finalName}</finalName>
  186. </configuration>
  187. <executions>
  188. <execution>
  189. <goals>
  190. <goal>repackage</goal>
  191. </goals>
  192. </execution>
  193. </executions>
  194. </plugin>
  195. </plugins>
  196. </pluginManagement>
  197. <plugins>
  198. <plugin>
  199. <groupId>org.springframework.boot</groupId>
  200. <artifactId>spring-boot-maven-plugin</artifactId>
  201. <executions>
  202. <execution>
  203. <goals>
  204. <goal>repackage</goal>
  205. </goals>
  206. </execution>
  207. </executions>
  208. </plugin>
  209. </plugins>
  210. </build>
  211. </project>