pom.xml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  2. <modelVersion>4.0.0</modelVersion>
  3. <parent>
  4. <groupId>com.alibaba.otter</groupId>
  5. <artifactId>canal</artifactId>
  6. <version>1.1.6-SNAPSHOT</version>
  7. <relativePath>../pom.xml</relativePath>
  8. </parent>
  9. <groupId>com.alibaba.otter</groupId>
  10. <artifactId>canal.deployer</artifactId>
  11. <packaging>jar</packaging>
  12. <name>canal deployer module for otter ${project.version}</name>
  13. <dependencies>
  14. <dependency>
  15. <groupId>com.alibaba.otter</groupId>
  16. <artifactId>canal.server</artifactId>
  17. <version>${project.version}</version>
  18. </dependency>
  19. <!-- 这里指定runtime的metrics provider-->
  20. <dependency>
  21. <groupId>com.alibaba.otter</groupId>
  22. <artifactId>canal.prometheus</artifactId>
  23. <version>${project.version}</version>
  24. <scope>runtime</scope>
  25. </dependency>
  26. <dependency>
  27. <groupId>com.alibaba.otter</groupId>
  28. <artifactId>connector.kafka</artifactId>
  29. <version>${project.version}</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>${project.version}</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>${project.version}</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. </dependencies>
  66. <build>
  67. <plugins>
  68. <plugin>
  69. <artifactId>maven-jar-plugin</artifactId>
  70. <configuration>
  71. <archive>
  72. <addMavenDescriptor>true</addMavenDescriptor>
  73. </archive>
  74. <excludes>
  75. <exclude>**/logback.xml</exclude>
  76. <exclude>**/canal.properties</exclude>
  77. <exclude>**/spring/**</exclude>
  78. <exclude>**/example/**</exclude>
  79. <exclude>**/mq.yml</exclude>
  80. </excludes>
  81. </configuration>
  82. </plugin>
  83. <plugin>
  84. <groupId>org.apache.maven.plugins</groupId>
  85. <artifactId>maven-dependency-plugin</artifactId>
  86. <version>2.10</version>
  87. <executions>
  88. <execution>
  89. <id>copy-dependencies-to-canal-deployer</id>
  90. <phase>package</phase>
  91. <goals>
  92. <goal>copy-dependencies</goal>
  93. </goals>
  94. <configuration>
  95. <includeClassifiers>jar-with-dependencies</includeClassifiers>
  96. <outputDirectory>${project.basedir}/target/canal/plugin</outputDirectory>
  97. </configuration>
  98. </execution>
  99. </executions>
  100. </plugin>
  101. <plugin>
  102. <groupId>org.apache.maven.plugins</groupId>
  103. <artifactId>maven-assembly-plugin</artifactId>
  104. <!-- 这是最新版本,推荐使用这个版本 -->
  105. <version>2.2.1</version>
  106. <executions>
  107. <execution>
  108. <id>assemble</id>
  109. <goals>
  110. <goal>single</goal>
  111. </goals>
  112. <phase>package</phase>
  113. </execution>
  114. </executions>
  115. <configuration>
  116. <appendAssemblyId>false</appendAssemblyId>
  117. <attach>false</attach>
  118. </configuration>
  119. </plugin>
  120. </plugins>
  121. </build>
  122. <profiles>
  123. <profile>
  124. <id>dev</id>
  125. <activation>
  126. <activeByDefault>true</activeByDefault>
  127. <property>
  128. <name>env</name>
  129. <value>!release</value>
  130. </property>
  131. </activation>
  132. <build>
  133. <plugins>
  134. <plugin>
  135. <artifactId>maven-assembly-plugin</artifactId>
  136. <configuration>
  137. <!-- maven assembly插件需要一个描述文件 来告诉插件包的结构以及打包所需的文件来自哪里 -->
  138. <descriptors>
  139. <descriptor>${basedir}/src/main/assembly/dev.xml</descriptor>
  140. </descriptors>
  141. <finalName>canal</finalName>
  142. <outputDirectory>${project.build.directory}</outputDirectory>
  143. </configuration>
  144. </plugin>
  145. </plugins>
  146. </build>
  147. </profile>
  148. <profile>
  149. <id>release</id>
  150. <activation>
  151. <property>
  152. <name>env</name>
  153. <value>release</value>
  154. </property>
  155. </activation>
  156. <build>
  157. <plugins>
  158. <plugin>
  159. <artifactId>maven-assembly-plugin</artifactId>
  160. <configuration>
  161. <!-- 发布模式使用的maven assembly插件描述文件 -->
  162. <descriptors>
  163. <descriptor>${basedir}/src/main/assembly/release.xml</descriptor>
  164. </descriptors>
  165. <!-- 如果一个应用的包含多个deploy模块,如果使用同样的包名, 如果把它们复制的一个目录中可能会失败,所以包名加了 artifactId以示区分 -->
  166. <finalName>${project.artifactId}-${project.version}</finalName>
  167. <!-- scm 要求 release 模式打出的包放到顶级目录下的target子目录中 -->
  168. <outputDirectory>${project.parent.build.directory}</outputDirectory>
  169. </configuration>
  170. </plugin>
  171. </plugins>
  172. </build>
  173. </profile>
  174. </profiles>
  175. </project>