pom.xml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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. <artifactId>spring5-gateway</artifactId>
  6. <packaging>jar</packaging>
  7. <name>${project.artifactId}</name>
  8. <description>spring5 demo</description>
  9. <!-- Spring Boot 启动父依赖 -->
  10. <parent>
  11. <groupId>com.yaozhitech</groupId>
  12. <artifactId>spring5</artifactId>
  13. <version>0.1.0</version>
  14. </parent>
  15. <dependencies>
  16. <!-- 网关 -->
  17. <dependency>
  18. <groupId>org.springframework.cloud</groupId>
  19. <artifactId>spring-cloud-starter-gateway</artifactId>
  20. </dependency>
  21. <!-- hystrix -->
  22. <dependency>
  23. <groupId>org.springframework.cloud</groupId>
  24. <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
  25. </dependency>
  26. <!-- 最新推荐的断路器 -->
  27. <!-- <dependency> -->
  28. <!-- <groupId>org.springframework.cloud</groupId> -->
  29. <!-- <artifactId>spring-cloud-starter-circuitbreaker-reactor-resilience4j</artifactId> -->
  30. <!-- </dependency> -->
  31. <!-- Spring Boot Web Flux 依赖 -->
  32. <dependency>
  33. <groupId>org.springframework.boot</groupId>
  34. <artifactId>spring-boot-starter-webflux</artifactId>
  35. </dependency>
  36. <!-- Spring Boot 响应式 Redis 依赖 -->
  37. <dependency>
  38. <groupId>org.springframework.boot</groupId>
  39. <artifactId>spring-boot-starter-data-redis-reactive</artifactId>
  40. </dependency>
  41. <dependency>
  42. <groupId>com.alicp.jetcache</groupId>
  43. <artifactId>jetcache-starter-redis</artifactId>
  44. <version>2.6.0.M3</version>
  45. </dependency>
  46. <dependency>
  47. <groupId>com.alicp.jetcache</groupId>
  48. <artifactId>jetcache-redis-lettuce</artifactId>
  49. <version>2.6.0.M3</version>
  50. </dependency>
  51. <!--swagger文档-->
  52. <dependency>
  53. <groupId>io.springfox</groupId>
  54. <artifactId>springfox-swagger-ui</artifactId>
  55. <version>2.9.2</version>
  56. </dependency>
  57. <dependency>
  58. <groupId>io.springfox</groupId>
  59. <artifactId>springfox-swagger2</artifactId>
  60. <version>2.9.2</version>
  61. </dependency>
  62. <!-- Spring test 依赖 -->
  63. <dependency>
  64. <groupId>org.springframework.boot</groupId>
  65. <artifactId>spring-boot-starter-test</artifactId>
  66. <scope>test</scope>
  67. </dependency>
  68. <dependency>
  69. <groupId>junit</groupId>
  70. <artifactId>junit</artifactId>
  71. <scope>test</scope>
  72. </dependency>
  73. <!-- 集成wireMock来实现mock请求响应。wireMock会自动构建一个虚拟远程服务 -->
  74. <dependency>
  75. <groupId>org.springframework.cloud</groupId>
  76. <artifactId>spring-cloud-contract-wiremock</artifactId>
  77. <scope>test</scope>
  78. </dependency>
  79. <!-- 提供打包预定义数据服务 -->
  80. <dependency>
  81. <groupId>org.springframework.cloud</groupId>
  82. <artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
  83. <scope>test</scope>
  84. </dependency>
  85. <!-- 自动生成单元测试代码 -->
  86. <dependency>
  87. <groupId>org.springframework.cloud</groupId>
  88. <artifactId>spring-cloud-starter-contract-verifier</artifactId>
  89. <scope>test</scope>
  90. </dependency>
  91. <dependency>
  92. <groupId>com.github.tomakehurst</groupId>
  93. <artifactId>wiremock-standalone</artifactId>
  94. <scope>test</scope>
  95. </dependency>
  96. </dependencies>
  97. <build>
  98. <plugins>
  99. <!--docker镜像build插件-->
  100. <plugin>
  101. <groupId>com.spotify</groupId>
  102. <artifactId>docker-maven-plugin</artifactId>
  103. <version>1.2.0</version>
  104. <configuration>
  105. <!-- 注意imageName一定要是符合正则[a-z0-9-_.]的,否则构建不会成功 -->
  106. <imageName>yaozhitech/${project.artifactId}</imageName>
  107. <dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
  108. <rm>true</rm>
  109. <resources>
  110. <resource>
  111. <targetPath>/</targetPath>
  112. <directory>${project.build.directory}</directory>
  113. <include>${project.build.finalName}.jar</include>
  114. </resource>
  115. </resources>
  116. </configuration>
  117. </plugin>
  118. <!-- 打包时跳过单元测试 -->
  119. <plugin>
  120. <groupId>org.apache.maven.plugins</groupId>
  121. <artifactId>maven-surefire-plugin</artifactId>
  122. <configuration>
  123. <skipTests>true</skipTests>
  124. </configuration>
  125. </plugin>
  126. <plugin>
  127. <groupId>org.springframework.boot</groupId>
  128. <artifactId>spring-boot-maven-plugin</artifactId>
  129. <version>2.1.4.RELEASE</version>
  130. <executions>
  131. <execution>
  132. <goals>
  133. <goal>build-info</goal>
  134. <goal>repackage</goal>
  135. </goals>
  136. </execution>
  137. </executions>
  138. </plugin>
  139. </plugins>
  140. </build>
  141. </project>