pom.xml 7.3 KB

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