pom.xml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. <!-- Spring test 依赖 -->
  52. <dependency>
  53. <groupId>org.springframework.boot</groupId>
  54. <artifactId>spring-boot-starter-test</artifactId>
  55. <scope>test</scope>
  56. </dependency>
  57. <dependency>
  58. <groupId>junit</groupId>
  59. <artifactId>junit</artifactId>
  60. <scope>test</scope>
  61. </dependency>
  62. <!-- 集成wireMock来实现mock请求响应。wireMock会自动构建一个虚拟远程服务 -->
  63. <dependency>
  64. <groupId>org.springframework.cloud</groupId>
  65. <artifactId>spring-cloud-contract-wiremock</artifactId>
  66. <scope>test</scope>
  67. </dependency>
  68. <!-- 提供打包预定义数据服务 -->
  69. <dependency>
  70. <groupId>org.springframework.cloud</groupId>
  71. <artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
  72. <scope>test</scope>
  73. </dependency>
  74. <!-- 自动生成单元测试代码 -->
  75. <dependency>
  76. <groupId>org.springframework.cloud</groupId>
  77. <artifactId>spring-cloud-starter-contract-verifier</artifactId>
  78. <scope>test</scope>
  79. </dependency>
  80. <dependency>
  81. <groupId>com.github.tomakehurst</groupId>
  82. <artifactId>wiremock-standalone</artifactId>
  83. <scope>test</scope>
  84. </dependency>
  85. </dependencies>
  86. <build>
  87. <plugins>
  88. <!--docker镜像build插件-->
  89. <plugin>
  90. <groupId>com.spotify</groupId>
  91. <artifactId>docker-maven-plugin</artifactId>
  92. <version>1.2.0</version>
  93. <configuration>
  94. <!-- 注意imageName一定要是符合正则[a-z0-9-_.]的,否则构建不会成功 -->
  95. <imageName>yaozhitech/${project.artifactId}</imageName>
  96. <dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
  97. <rm>true</rm>
  98. <resources>
  99. <resource>
  100. <targetPath>/</targetPath>
  101. <directory>${project.build.directory}</directory>
  102. <include>${project.build.finalName}.jar</include>
  103. </resource>
  104. </resources>
  105. </configuration>
  106. </plugin>
  107. </plugins>
  108. </build>
  109. </project>