2.0重构版本
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

223 рядки
8.3 KiB

  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3. <modelVersion>4.0.0</modelVersion>
  4. <parent>
  5. <groupId>org.springframework.boot</groupId>
  6. <artifactId>spring-boot-starter-parent</artifactId>
  7. <version>2.6.9</version>
  8. <relativePath/> <!-- lookup parent from repository -->
  9. </parent>
  10. <groupId>cc.smtweb</groupId>
  11. <artifactId>canal.deployer</artifactId>
  12. <version>1.1.6</version>
  13. <dependencies>
  14. <dependency>
  15. <groupId>com.alibaba.otter</groupId>
  16. <artifactId>canal.server</artifactId>
  17. <version>1.1.6</version>
  18. </dependency>
  19. <!-- 这里指定runtime的metrics provider-->
  20. <dependency>
  21. <groupId>com.alibaba.otter</groupId>
  22. <artifactId>canal.prometheus</artifactId>
  23. <version>1.1.6</version>
  24. <scope>runtime</scope>
  25. </dependency>
  26. <dependency>
  27. <groupId>com.alibaba.otter</groupId>
  28. <artifactId>connector.kafka</artifactId>
  29. <version>1.1.6</version>
  30. <exclusions>
  31. <exclusion>
  32. <artifactId>*</artifactId>
  33. <groupId>*</groupId>
  34. </exclusion>
  35. </exclusions>
  36. <classifier>jar-with-dependencies</classifier>
  37. <scope>provided</scope>
  38. </dependency>
  39. <dependency>
  40. <groupId>com.alibaba.otter</groupId>
  41. <artifactId>connector.rocketmq</artifactId>
  42. <version>1.1.6</version>
  43. <exclusions>
  44. <exclusion>
  45. <artifactId>*</artifactId>
  46. <groupId>*</groupId>
  47. </exclusion>
  48. </exclusions>
  49. <classifier>jar-with-dependencies</classifier>
  50. <scope>provided</scope>
  51. </dependency>
  52. <dependency>
  53. <groupId>com.alibaba.otter</groupId>
  54. <artifactId>connector.rabbitmq</artifactId>
  55. <version>1.1.6</version>
  56. <exclusions>
  57. <exclusion>
  58. <artifactId>*</artifactId>
  59. <groupId>*</groupId>
  60. </exclusion>
  61. </exclusions>
  62. <classifier>jar-with-dependencies</classifier>
  63. <scope>provided</scope>
  64. </dependency>
  65. <dependency>
  66. <groupId>com.alibaba.otter</groupId>
  67. <artifactId>connector.pulsarmq</artifactId>
  68. <version>1.1.6</version>
  69. <exclusions>
  70. <exclusion>
  71. <artifactId>*</artifactId>
  72. <groupId>*</groupId>
  73. </exclusion>
  74. </exclusions>
  75. <classifier>jar-with-dependencies</classifier>
  76. <scope>provided</scope>
  77. </dependency>
  78. <dependency>
  79. <groupId>org.springframework.boot</groupId>
  80. <artifactId>spring-boot-autoconfigure</artifactId>
  81. </dependency>
  82. <dependency>
  83. <groupId>cc.smtweb</groupId>
  84. <artifactId>sw-framework-core</artifactId>
  85. <version>3.1.0-SNAPSHOT</version>
  86. </dependency>
  87. <dependency>
  88. <groupId>cc.smtweb</groupId>
  89. <artifactId>sw-system-bpm</artifactId>
  90. <version>3.1.0-SNAPSHOT</version>
  91. </dependency>
  92. </dependencies>
  93. <build>
  94. <plugins>
  95. <!--<plugin>
  96. <groupId>org.springframework.boot</groupId>
  97. <artifactId>spring-boot-maven-plugin</artifactId>
  98. </plugin>-->
  99. <plugin>
  100. <artifactId>maven-jar-plugin</artifactId>
  101. <configuration>
  102. <archive>
  103. <addMavenDescriptor>true</addMavenDescriptor>
  104. </archive>
  105. <excludes>
  106. <exclude>**/logback.xml</exclude>
  107. <exclude>**/canal.properties</exclude>
  108. <exclude>**/spring/**</exclude>
  109. <exclude>**/example/**</exclude>
  110. <exclude>**/mq.yml</exclude>
  111. </excludes>
  112. </configuration>
  113. </plugin>
  114. <plugin>
  115. <groupId>org.apache.maven.plugins</groupId>
  116. <artifactId>maven-dependency-plugin</artifactId>
  117. <version>2.10</version>
  118. <executions>
  119. <execution>
  120. <id>copy-dependencies-to-canal-deployer</id>
  121. <phase>package</phase>
  122. <goals>
  123. <goal>copy-dependencies</goal>
  124. </goals>
  125. <configuration>
  126. <includeClassifiers>jar-with-dependencies</includeClassifiers>
  127. <outputDirectory>${project.basedir}/target/canal/plugin</outputDirectory>
  128. </configuration>
  129. </execution>
  130. </executions>
  131. </plugin>
  132. <plugin>
  133. <groupId>org.apache.maven.plugins</groupId>
  134. <artifactId>maven-assembly-plugin</artifactId>
  135. <!-- 这是最新版本,推荐使用这个版本 -->
  136. <version>2.2.1</version>
  137. <executions>
  138. <execution>
  139. <id>assemble</id>
  140. <goals>
  141. <goal>single</goal>
  142. </goals>
  143. <phase>package</phase>
  144. </execution>
  145. </executions>
  146. <configuration>
  147. <appendAssemblyId>false</appendAssemblyId>
  148. <attach>false</attach>
  149. </configuration>
  150. </plugin>
  151. </plugins>
  152. </build>
  153. <profiles>
  154. <profile>
  155. <id>dev</id>
  156. <activation>
  157. <activeByDefault>true</activeByDefault>
  158. <property>
  159. <name>env</name>
  160. <value>!release</value>
  161. </property>
  162. </activation>
  163. <build>
  164. <plugins>
  165. <plugin>
  166. <artifactId>maven-assembly-plugin</artifactId>
  167. <configuration>
  168. <!-- maven assembly插件需要一个描述文件 来告诉插件包的结构以及打包所需的文件来自哪里 -->
  169. <descriptors>
  170. <descriptor>${basedir}/src/main/assembly/dev.xml</descriptor>
  171. </descriptors>
  172. <finalName>canal-deployer</finalName>
  173. <outputDirectory>${project.build.directory}</outputDirectory>
  174. </configuration>
  175. </plugin>
  176. </plugins>
  177. </build>
  178. </profile>
  179. <profile>
  180. <id>release</id>
  181. <activation>
  182. <property>
  183. <name>env</name>
  184. <value>release</value>
  185. </property>
  186. </activation>
  187. <build>
  188. <plugins>
  189. <plugin>
  190. <artifactId>maven-assembly-plugin</artifactId>
  191. <configuration>
  192. <!-- 发布模式使用的maven assembly插件描述文件 -->
  193. <descriptors>
  194. <descriptor>${basedir}/src/main/assembly/release.xml</descriptor>
  195. </descriptors>
  196. <!-- 如果一个应用的包含多个deploy模块,如果使用同样的包名, 如果把它们复制的一个目录中可能会失败,所以包名加了 artifactId以示区分 -->
  197. <finalName>${project.artifactId}-1.1.6</finalName>
  198. <!-- scm 要求 release 模式打出的包放到顶级目录下的target子目录中 -->
  199. <outputDirectory>${project.parent.build.directory}</outputDirectory>
  200. </configuration>
  201. </plugin>
  202. </plugins>
  203. </build>
  204. </profile>
  205. </profiles>
  206. </project>