pom.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xmlns="http://maven.apache.org/POM/4.0.0"
  4. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5. <modelVersion>4.0.0</modelVersion>
  6. <groupId>com.dk.mes</groupId>
  7. <artifactId>mes-server-gateway</artifactId>
  8. <version>3.0.0</version>
  9. <name>mes-server-gateway</name>
  10. <description>dk mes gateway server</description>
  11. <parent>
  12. <groupId>org.springframework.boot</groupId>
  13. <artifactId>spring-boot-starter-parent</artifactId>
  14. <version>2.2.6.RELEASE</version>
  15. <relativePath/>
  16. </parent>
  17. <properties>
  18. <maven.compiler.source>8</maven.compiler.source>
  19. <maven.compiler.target>8</maven.compiler.target>
  20. <springframework-cloud.version>Hoxton.RELEASE</springframework-cloud.version>
  21. <alibaba-cloud.version>2.2.0.RELEASE</alibaba-cloud.version>
  22. </properties>
  23. <profiles>
  24. <profile>
  25. <id>st</id>
  26. <properties>
  27. <environment>st</environment>
  28. </properties>
  29. </profile>
  30. <profile>
  31. <id>uat</id>
  32. <properties>
  33. <environment>uat</environment>
  34. </properties>
  35. </profile>
  36. <profile>
  37. <id>prod</id>
  38. <properties>
  39. <environment>prod</environment>
  40. </properties>
  41. </profile>
  42. <profile>
  43. <id>test</id>
  44. <properties>
  45. <environment>test</environment>
  46. </properties>
  47. </profile>
  48. <profile>
  49. <id>dev</id>
  50. <properties>
  51. <environment>dev</environment>
  52. </properties>
  53. <activation>
  54. <activeByDefault>true</activeByDefault><!-- 默认激活该profile节点-->
  55. </activation>
  56. </profile>
  57. </profiles>
  58. <dependencyManagement>
  59. <dependencies>
  60. <!--整合spring cloud-->
  61. <dependency>
  62. <groupId>org.springframework.cloud</groupId>
  63. <artifactId>spring-cloud-dependencies</artifactId>
  64. <version>${springframework-cloud.version}</version>
  65. <type>pom</type>
  66. <scope>import</scope>
  67. </dependency>
  68. <!--整合spring cloud alibaba-->
  69. <dependency>
  70. <groupId>com.alibaba.cloud</groupId>
  71. <artifactId>spring-cloud-alibaba-dependencies</artifactId>
  72. <version>${alibaba-cloud.version}</version>
  73. <type>pom</type>
  74. <scope>import</scope>
  75. </dependency>
  76. </dependencies>
  77. </dependencyManagement>
  78. <dependencies>
  79. <dependency>
  80. <groupId>com.alibaba.cloud</groupId>
  81. <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
  82. </dependency>
  83. <!--项目整合Nacos实现配置管理-->
  84. <dependency>
  85. <groupId>com.alibaba.cloud</groupId>
  86. <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
  87. </dependency>
  88. <!--必须加,不加不注册-->
  89. <dependency>
  90. <groupId>org.springframework.boot</groupId>
  91. <artifactId>spring-boot-starter-actuator</artifactId>
  92. </dependency>
  93. <!--lombok-->
  94. <dependency>
  95. <groupId>org.projectlombok</groupId>
  96. <artifactId>lombok</artifactId>
  97. <optional>true</optional>
  98. </dependency>
  99. <!--sentinel-->
  100. <dependency>
  101. <groupId>com.alibaba.cloud</groupId>
  102. <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
  103. </dependency>
  104. <!--redis-->
  105. <dependency>
  106. <groupId>org.springframework.boot</groupId>
  107. <artifactId>spring-boot-starter-data-redis</artifactId>
  108. <version>2.3.1.RELEASE</version>
  109. </dependency>
  110. <!--zipkin-->
  111. <!-- <dependency>-->
  112. <!-- <groupId>org.springframework.cloud</groupId>-->
  113. <!-- <artifactId>spring-cloud-starter-zipkin</artifactId>-->
  114. <!-- </dependency>-->
  115. <!--webflux与webmvc不兼容,需要排除掉,否则会项目启动不起来-->
  116. <dependency>
  117. <groupId>org.springframework.boot</groupId>
  118. <artifactId>spring-boot-starter-web</artifactId>
  119. <exclusions>
  120. <exclusion>
  121. <groupId>org.springframework</groupId>
  122. <artifactId>spring-webmvc</artifactId>
  123. </exclusion>
  124. <exclusion>
  125. <groupId>org.apache.tomcat.embed</groupId>
  126. <artifactId>tomcat-embed-core</artifactId>
  127. </exclusion>
  128. </exclusions>
  129. </dependency>
  130. <!--webflux-->
  131. <dependency>
  132. <groupId>org.springframework.boot</groupId>
  133. <artifactId>spring-boot-starter-webflux</artifactId>
  134. </dependency>
  135. <!--服务发现-->
  136. <dependency>
  137. <groupId>com.alibaba.cloud</groupId>
  138. <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
  139. </dependency>
  140. <!--gateway网关-->
  141. <dependency>
  142. <groupId>org.springframework.cloud</groupId>
  143. <artifactId>spring-cloud-starter-gateway</artifactId>
  144. </dependency>
  145. <!--feign-->
  146. <dependency>
  147. <groupId>org.springframework.cloud</groupId>
  148. <artifactId>spring-cloud-starter-openfeign</artifactId>
  149. </dependency>
  150. <!--loadbalancer-->
  151. <dependency>
  152. <groupId>org.springframework.cloud</groupId>
  153. <artifactId>spring-cloud-starter-loadbalancer</artifactId>
  154. </dependency>
  155. <!-- JWT -->
  156. <dependency>
  157. <groupId>com.auth0</groupId>
  158. <artifactId>java-jwt</artifactId>
  159. <version>3.4.1</version>
  160. </dependency>
  161. </dependencies>
  162. <build>
  163. <resources>
  164. <resource> <!--此处配置到java是因为mapper.xml文件在java目录-->
  165. <directory>src/main/java</directory>
  166. <includes>
  167. <include>**/*.xml</include>
  168. </includes>
  169. <filtering>false</filtering>
  170. </resource>
  171. <resource> <!--项目配置文件-->
  172. <directory>src/main/resources/${environment}</directory>
  173. <includes>
  174. <include>**/*</include>
  175. </includes>
  176. <!-- 启用过滤器,过滤器会解析需要过滤的的资源文件,将其中的@environment@变量替换成真实的值 -->
  177. <filtering>true</filtering>
  178. </resource>
  179. <resource> <!--日志配置文件-->
  180. <directory>src/main/resources</directory>
  181. <includes>
  182. <include>**/*</include>
  183. </includes>
  184. <!-- 启用过滤器,过滤器会解析需要过滤的的资源文件,将其中的@environment@变量替换成真实的值 -->
  185. <filtering>true</filtering>
  186. </resource>
  187. </resources>
  188. <plugins>
  189. <plugin>
  190. <groupId>org.springframework.boot</groupId>
  191. <artifactId>spring-boot-maven-plugin</artifactId>
  192. <configuration>
  193. <mainClass>com.dk.gateway.GatewayServer</mainClass>
  194. </configuration>
  195. <executions>
  196. <execution>
  197. <goals>
  198. <goal>repackage</goal>
  199. </goals>
  200. </execution>
  201. </executions>
  202. </plugin>
  203. <plugin>
  204. <groupId>com.spotify</groupId>
  205. <artifactId>docker-maven-plugin</artifactId>
  206. <version>1.2.2</version>
  207. <configuration>
  208. <serverId>aliyun-acr</serverId>
  209. <registryUrl>registry.cn-shenzhen.aliyuncs.com</registryUrl>
  210. <!--依赖的基础镜像-->
  211. <baseImage>java</baseImage>
  212. <!--imageName必须跟仓库路径一致-->
  213. <imageName>registry.cn-shenzhen.aliyuncs.com/hgscrm-${environment}/${project.artifactId}:${project.version}</imageName>
  214. <!-- 指定Dockerfile所在的路径 -->
  215. <dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
  216. <resources>
  217. <resource>
  218. <targetPath>/</targetPath>
  219. <directory>${project.build.directory}</directory>
  220. <include>${project.build.finalName}.jar</include>
  221. </resource>
  222. </resources>
  223. <pushImage>true</pushImage>
  224. </configuration>
  225. </plugin>
  226. </plugins>
  227. </build>
  228. <repositories>
  229. <repository>
  230. <!--恒洁maven私服 haip仓库-->
  231. <id>private</id>
  232. <name>private</name>
  233. <url>http://172.17.216.67:8081/repository/haip</url>
  234. <releases>
  235. <enabled>true</enabled>
  236. </releases>
  237. <snapshots>
  238. <enabled>true</enabled>
  239. </snapshots>
  240. </repository>
  241. <!--maven私服 setting.xml 配置
  242. <server>
  243. <id>haip</id>
  244. <username>haip</username>
  245. <password>haip2020</password>
  246. </server>-->
  247. <!--阿里云仓库-->
  248. <repository>
  249. <id>aliyun</id>
  250. <name>aliyun</name>
  251. <url>https://maven.aliyun.com/repository/public</url>
  252. <releases>
  253. <enabled>true</enabled>
  254. </releases>
  255. <snapshots>
  256. <enabled>true</enabled>
  257. </snapshots>
  258. </repository>
  259. <!--中央仓库-->
  260. <repository>
  261. <id>central</id>
  262. <name>central</name>
  263. <url>https://repo1.maven.org/maven2</url>
  264. <releases>
  265. <enabled>true</enabled>
  266. </releases>
  267. <snapshots>
  268. <enabled>true</enabled>
  269. </snapshots>
  270. </repository>
  271. </repositories>
  272. </project>