pom.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ~ Copyright 1999-2019 Seata.io Group.
  4. ~
  5. ~ Licensed under the Apache License, Version 2.0 (the "License");
  6. ~ you may not use this file except in compliance with the License.
  7. ~ You may obtain a copy of the License at
  8. ~
  9. ~ http://www.apache.org/licenses/LICENSE-2.0
  10. ~
  11. ~ Unless required by applicable law or agreed to in writing, software
  12. ~ distributed under the License is distributed on an "AS IS" BASIS,
  13. ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. ~ See the License for the specific language governing permissions and
  15. ~ limitations under the License.
  16. -->
  17. <project xmlns="http://maven.apache.org/POM/4.0.0"
  18. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  19. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  20. <parent>
  21. <groupId>io.seata</groupId>
  22. <artifactId>seata-parent</artifactId>
  23. <version>${revision}</version>
  24. </parent>
  25. <modelVersion>4.0.0</modelVersion>
  26. <artifactId>seata-server</artifactId>
  27. <packaging>jar</packaging>
  28. <name>seata-server ${project.version}</name>
  29. <description>server for Seata built with Maven</description>
  30. <properties>
  31. <spring-boot-for-server.version>${spring-boot.version}</spring-boot-for-server.version>
  32. <spring-framework-for-server.version>${spring-framework.version}</spring-framework-for-server.version>
  33. </properties>
  34. <dependencyManagement>
  35. <dependencies>
  36. <!-- junit5 -->
  37. <dependency>
  38. <groupId>org.junit</groupId>
  39. <artifactId>junit-bom</artifactId>
  40. <version>${junit-jupiter.version}</version>
  41. <type>pom</type>
  42. <scope>import</scope>
  43. </dependency>
  44. <!-- spring-framework-->
  45. <dependency>
  46. <groupId>org.springframework</groupId>
  47. <artifactId>spring-framework-bom</artifactId>
  48. <version>${spring-framework-for-server.version}</version>
  49. <type>pom</type>
  50. <scope>import</scope>
  51. </dependency>
  52. <!-- spring-boot -->
  53. <dependency>
  54. <groupId>org.springframework.boot</groupId>
  55. <artifactId>spring-boot-dependencies</artifactId>
  56. <version>${spring-boot-for-server.version}</version>
  57. <exclusions>
  58. <exclusion>
  59. <groupId>org.springframework</groupId>
  60. <artifactId>spring-framework-bom</artifactId>
  61. </exclusion>
  62. </exclusions>
  63. <type>pom</type>
  64. <scope>import</scope>
  65. </dependency>
  66. </dependencies>
  67. </dependencyManagement>
  68. <dependencies>
  69. <!-- springboot web -->
  70. <dependency>
  71. <groupId>org.springframework.boot</groupId>
  72. <artifactId>spring-boot-starter-web</artifactId>
  73. <exclusions>
  74. <exclusion>
  75. <artifactId>log4j-to-slf4j</artifactId>
  76. <groupId>org.apache.logging.log4j</groupId>
  77. </exclusion>
  78. </exclusions>
  79. </dependency>
  80. <dependency>
  81. <groupId>org.springframework.boot</groupId>
  82. <artifactId>spring-boot-starter-test</artifactId>
  83. <scope>test</scope>
  84. <exclusions>
  85. <exclusion>
  86. <groupId>org.junit.vintage</groupId>
  87. <artifactId>junit-vintage-engine</artifactId>
  88. </exclusion>
  89. </exclusions>
  90. </dependency>
  91. <dependency>
  92. <groupId>${project.groupId}</groupId>
  93. <artifactId>seata-spring-autoconfigure-server</artifactId>
  94. <version>${project.version}</version>
  95. </dependency>
  96. <dependency>
  97. <groupId>${project.groupId}</groupId>
  98. <artifactId>seata-core</artifactId>
  99. <version>${project.version}</version>
  100. </dependency>
  101. <dependency>
  102. <groupId>${project.groupId}</groupId>
  103. <artifactId>seata-config-all</artifactId>
  104. <version>${project.version}</version>
  105. <exclusions>
  106. <exclusion>
  107. <artifactId>log4j</artifactId>
  108. <groupId>log4j</groupId>
  109. </exclusion>
  110. </exclusions>
  111. </dependency>
  112. <dependency>
  113. <groupId>${project.groupId}</groupId>
  114. <artifactId>seata-discovery-all</artifactId>
  115. <version>${project.version}</version>
  116. </dependency>
  117. <dependency>
  118. <groupId>${project.groupId}</groupId>
  119. <artifactId>seata-serializer-all</artifactId>
  120. <version>${project.version}</version>
  121. </dependency>
  122. <dependency>
  123. <groupId>${project.groupId}</groupId>
  124. <artifactId>seata-compressor-all</artifactId>
  125. <version>${project.version}</version>
  126. </dependency>
  127. <dependency>
  128. <groupId>${project.groupId}</groupId>
  129. <artifactId>seata-metrics-all</artifactId>
  130. <version>${project.version}</version>
  131. </dependency>
  132. <dependency>
  133. <groupId>${project.groupId}</groupId>
  134. <artifactId>seata-console</artifactId>
  135. <version>${project.version}</version>
  136. </dependency>
  137. <!-- for database -->
  138. <dependency>
  139. <groupId>com.alibaba</groupId>
  140. <artifactId>druid</artifactId>
  141. </dependency>
  142. <dependency>
  143. <groupId>org.apache.commons</groupId>
  144. <artifactId>commons-dbcp2</artifactId>
  145. </dependency>
  146. <dependency>
  147. <groupId>com.zaxxer</groupId>
  148. <artifactId>HikariCP</artifactId>
  149. </dependency>
  150. <dependency>
  151. <groupId>com.h2database</groupId>
  152. <artifactId>h2</artifactId>
  153. </dependency>
  154. <!-- if you run seata-server in IDE and use mysql8 as session store, please rewrite version to ${mysql8.jdbc.version}-->
  155. <dependency>
  156. <groupId>mysql</groupId>
  157. <artifactId>mysql-connector-java</artifactId>
  158. </dependency>
  159. <dependency>
  160. <groupId>org.postgresql</groupId>
  161. <artifactId>postgresql</artifactId>
  162. </dependency>
  163. <!-- Copyright restrictions, do not reference this dependency.
  164. You can add this dependency to the '/seata/lib' directory of the seata-server when necessary.
  165. <dependency>
  166. <groupId>com.oracle.ojdbc</groupId>
  167. <artifactId>ojdbc8</artifactId>
  168. <version>${ojdbc.version}</version>
  169. </dependency>-->
  170. <dependency>
  171. <groupId>com.beust</groupId>
  172. <artifactId>jcommander</artifactId>
  173. </dependency>
  174. <!-- only for event bus -->
  175. <dependency>
  176. <groupId>com.google.guava</groupId>
  177. <artifactId>guava</artifactId>
  178. </dependency>
  179. <!-- jedis -->
  180. <dependency>
  181. <groupId>redis.clients</groupId>
  182. <artifactId>jedis</artifactId>
  183. </dependency>
  184. <dependency>
  185. <groupId>com.github.microwww</groupId>
  186. <artifactId>redis-server</artifactId>
  187. <scope>test</scope>
  188. </dependency>
  189. <dependency>
  190. <groupId>com.alibaba</groupId>
  191. <artifactId>fastjson</artifactId>
  192. </dependency>
  193. <!-- logback -->
  194. <dependency>
  195. <groupId>ch.qos.logback</groupId>
  196. <artifactId>logback-classic</artifactId>
  197. </dependency>
  198. <dependency>
  199. <groupId>ch.qos.logback</groupId>
  200. <artifactId>logback-core</artifactId>
  201. </dependency>
  202. <!-- logback appenders -->
  203. <dependency>
  204. <groupId>net.logstash.logback</groupId>
  205. <artifactId>logstash-logback-encoder</artifactId>
  206. </dependency>
  207. <dependency>
  208. <groupId>com.github.danielwegener</groupId>
  209. <artifactId>logback-kafka-appender</artifactId>
  210. </dependency>
  211. </dependencies>
  212. <build>
  213. <plugins>
  214. <plugin>
  215. <groupId>org.apache.maven.plugins</groupId>
  216. <artifactId>maven-deploy-plugin</artifactId>
  217. <configuration>
  218. <skip>true</skip>
  219. </configuration>
  220. </plugin>
  221. <plugin>
  222. <groupId>org.apache.maven.plugins</groupId>
  223. <artifactId>maven-dependency-plugin</artifactId>
  224. <executions>
  225. <execution>
  226. <id>copy-dependencies</id>
  227. <phase>package</phase>
  228. <goals>
  229. <goal>copy-dependencies</goal>
  230. </goals>
  231. <configuration>
  232. <outputDirectory>${project.build.directory}/lib</outputDirectory>
  233. <excludeTransitive>false</excludeTransitive>
  234. <stripVersion>false</stripVersion>
  235. <silent>true</silent>
  236. <overWriteIfNewer>true</overWriteIfNewer>
  237. <!--resolve slf4j-simple conflicts-->
  238. <includeScope>runtime</includeScope>
  239. <excludeGroupIds>org.apache.logging.log4j,log4j,mysql</excludeGroupIds>
  240. <skip>${dependencies.copy.skip}</skip>
  241. </configuration>
  242. </execution>
  243. <execution>
  244. <id>copy-mysql</id>
  245. <phase>package</phase>
  246. <goals>
  247. <goal>copy</goal>
  248. </goals>
  249. <configuration>
  250. <artifactItems>
  251. <artifactItem>
  252. <groupId>mysql</groupId>
  253. <artifactId>mysql-connector-java</artifactId>
  254. <version>${mysql.jdbc.version}</version>
  255. </artifactItem>
  256. <artifactItem>
  257. <groupId>mysql</groupId>
  258. <artifactId>mysql-connector-java</artifactId>
  259. <version>${mysql8.jdbc.version}</version>
  260. </artifactItem>
  261. </artifactItems>
  262. <outputDirectory>
  263. ${project.build.directory}/lib/jdbc
  264. </outputDirectory>
  265. <skip>${dependencies.copy.skip}</skip>
  266. </configuration>
  267. </execution>
  268. </executions>
  269. </plugin>
  270. <plugin>
  271. <groupId>com.google.cloud.tools</groupId>
  272. <artifactId>jib-maven-plugin</artifactId>
  273. <version>${jib-maven-plugin.version}</version>
  274. <configuration>
  275. <from>
  276. <image>${IMAGE_NAME}</image>
  277. <platforms>
  278. <platform>
  279. <os>linux</os>
  280. <architecture>amd64</architecture>
  281. </platform>
  282. <platform>
  283. <os>linux</os>
  284. <architecture>arm64</architecture>
  285. </platform>
  286. </platforms>
  287. </from>
  288. <to>
  289. <image>docker.io/seataio/seata-server</image>
  290. <tags>${image.tags}</tags>
  291. <auth>
  292. <username>${REGISTRY_USERNAME}</username>
  293. <password>${REGISTRY_PASSWORD}</password>
  294. </auth>
  295. </to>
  296. <container>
  297. <appRoot>/seata-server</appRoot>
  298. <workingDirectory>/seata-server</workingDirectory>
  299. <mainClass>io.seata.server.ServerApplication</mainClass>
  300. <ports>
  301. <port>8091</port>
  302. <port>7091</port>
  303. </ports>
  304. <jvmFlags>
  305. <jvmFlag>-Djava.security.egd=file:/dev/./urandom</jvmFlag>
  306. <jvmFlag>-server</jvmFlag>
  307. <jvmFlag>-Xss512k</jvmFlag>
  308. <jvmFlag>-XX:+UnlockExperimentalVMOptions</jvmFlag>
  309. <jvmFlag>-XX:+UseContainerSupport</jvmFlag>
  310. <jvmFlag>-XX:SurvivorRatio=10</jvmFlag>
  311. <jvmFlag>-XX:MetaspaceSize=128m</jvmFlag>
  312. <jvmFlag>-XX:MaxMetaspaceSize=256m</jvmFlag>
  313. <jvmFlag>-XX:MaxDirectMemorySize=256m</jvmFlag>
  314. <jvmFlag>-XX:-OmitStackTraceInFastThrow</jvmFlag>
  315. <jvmFlag>-XX:-UseAdaptiveSizePolicy</jvmFlag>
  316. <jvmFlag>-XX:+HeapDumpOnOutOfMemoryError</jvmFlag>
  317. <jvmFlag>-XX:HeapDumpPath=/var/log/seata_heapdump.hprof</jvmFlag>
  318. <!--gc-->
  319. <jvmFlag>-XX:+DisableExplicitGC</jvmFlag>
  320. <jvmFlag>-XX:+UseG1GC</jvmFlag>
  321. <!--netty-->
  322. <jvmFlag>-Dio.netty.leakDetectionLevel=advanced</jvmFlag>
  323. <!--log-->
  324. <jvmFlag>-Dlogback.color.disable-for-bat=true</jvmFlag>
  325. </jvmFlags>
  326. <labels>
  327. <name>seata-server</name>
  328. </labels>
  329. <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
  330. </container>
  331. <extraDirectories>
  332. <paths>
  333. <path>
  334. <from>target/lib/jdbc</from>
  335. <into>/seata-server/libs/jdbc</into>
  336. </path>
  337. </paths>
  338. </extraDirectories>
  339. <skip>${image.publish.skip}</skip>
  340. </configuration>
  341. <executions>
  342. <execution>
  343. <phase>package</phase>
  344. <goals>
  345. <goal>build</goal>
  346. </goals>
  347. </execution>
  348. </executions>
  349. </plugin>
  350. </plugins>
  351. </build>
  352. <profiles>
  353. <profile>
  354. <id>release-seata</id>
  355. <properties>
  356. <spring-boot.version>2.5.13</spring-boot.version>
  357. <mysql.jdbc.version>5.1.35</mysql.jdbc.version>
  358. <mysql8.jdbc.version>8.0.27</mysql8.jdbc.version>
  359. <dependencies.copy.skip>false</dependencies.copy.skip>
  360. </properties>
  361. <build>
  362. <finalName>seata-server</finalName>
  363. <plugins>
  364. <plugin>
  365. <groupId>org.springframework.boot</groupId>
  366. <artifactId>spring-boot-maven-plugin</artifactId>
  367. <version>${spring-boot.version}</version>
  368. <!--指定application-->
  369. <configuration>
  370. <mainClass>io.seata.server.ServerApplication</mainClass>
  371. <layout>ZIP</layout>
  372. <attach>false</attach>
  373. <!-- <addClasspath>true</addClasspath>-->
  374. <!-- <classpathPrefix>lib/</classpathPrefix>-->
  375. <!-- <includes>-->
  376. <!-- <include>-->
  377. <!-- <groupId>null</groupId>-->
  378. <!-- <artifactId>null</artifactId>-->
  379. <!-- </include>-->
  380. <!-- </includes>-->
  381. </configuration>
  382. <executions>
  383. <execution>
  384. <goals>
  385. <goal>repackage</goal>
  386. </goals>
  387. </execution>
  388. </executions>
  389. </plugin>
  390. </plugins>
  391. </build>
  392. </profile>
  393. </profiles>
  394. </project>