1
0

pom.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  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. <parent>
  7. <artifactId>canal</artifactId>
  8. <groupId>com.alibaba.otter</groupId>
  9. <version>1.0.26-SNAPSHOT</version>
  10. <relativePath>../pom.xml</relativePath>
  11. </parent>
  12. <groupId>com.alibaba.otter</groupId>
  13. <artifactId>canal.kafka</artifactId>
  14. <packaging>jar</packaging>
  15. <name>canal kafka module for otter ${project.version}</name>
  16. <dependencies>
  17. <dependency>
  18. <groupId>com.alibaba.otter</groupId>
  19. <artifactId>canal.deployer</artifactId>
  20. <version>${project.version}</version>
  21. </dependency>
  22. <dependency>
  23. <groupId>org.yaml</groupId>
  24. <artifactId>snakeyaml</artifactId>
  25. <version>1.17</version>
  26. </dependency>
  27. <dependency>
  28. <groupId>org.apache.kafka</groupId>
  29. <artifactId>kafka_2.11</artifactId>
  30. <version>1.1.1</version>
  31. <exclusions>
  32. <exclusion>
  33. <groupId>org.slf4j</groupId>
  34. <artifactId>slf4j-log4j12</artifactId>
  35. </exclusion>
  36. </exclusions>
  37. </dependency>
  38. <!--kafka_2.11_1.1.1 exclusion掉了netty 的依赖,但CanalServerWithNetty 依赖 netty3,升级kafka至 1.1.1 需要显示加入,否则会启动失败 -->
  39. <dependency>
  40. <groupId>org.jboss.netty</groupId>
  41. <artifactId>netty</artifactId>
  42. <version>3.2.2.Final</version>
  43. </dependency>
  44. </dependencies>
  45. <build>
  46. <plugins>
  47. <!-- deploy模块的packaging通常是jar,如果项目中没有java 源代码或资源文件,加上这一段配置使项目能通过构建 -->
  48. <plugin>
  49. <artifactId>maven-jar-plugin</artifactId>
  50. <configuration>
  51. <archive>
  52. <addMavenDescriptor>true</addMavenDescriptor>
  53. </archive>
  54. <excludes>
  55. <exclude>**/logback.xml</exclude>
  56. <exclude>**/canal.properties</exclude>
  57. <exclude>**/spring/**</exclude>
  58. <exclude>**/example/**</exclude>
  59. <exclude>**/kafka.yml</exclude>
  60. </excludes>
  61. </configuration>
  62. </plugin>
  63. <plugin>
  64. <groupId>org.apache.maven.plugins</groupId>
  65. <artifactId>maven-assembly-plugin</artifactId>
  66. <!-- 这是最新版本,推荐使用这个版本 -->
  67. <version>2.2.1</version>
  68. <executions>
  69. <execution>
  70. <id>assemble</id>
  71. <goals>
  72. <goal>single</goal>
  73. </goals>
  74. <phase>package</phase>
  75. </execution>
  76. </executions>
  77. <configuration>
  78. <appendAssemblyId>false</appendAssemblyId>
  79. <attach>false</attach>
  80. </configuration>
  81. </plugin>
  82. </plugins>
  83. </build>
  84. <profiles>
  85. <profile>
  86. <id>dev</id>
  87. <activation>
  88. <activeByDefault>true</activeByDefault>
  89. <property>
  90. <name>env</name>
  91. <value>!release</value>
  92. </property>
  93. </activation>
  94. <build>
  95. <plugins>
  96. <plugin>
  97. <artifactId>maven-assembly-plugin</artifactId>
  98. <configuration>
  99. <!-- maven assembly插件需要一个描述文件 来告诉插件包的结构以及打包所需的文件来自哪里 -->
  100. <descriptors>
  101. <descriptor>${basedir}/src/main/assembly/dev.xml</descriptor>
  102. </descriptors>
  103. <finalName>canal</finalName>
  104. <outputDirectory>${project.build.directory}</outputDirectory>
  105. </configuration>
  106. </plugin>
  107. </plugins>
  108. </build>
  109. </profile>
  110. <profile>
  111. <id>release</id>
  112. <activation>
  113. <property>
  114. <name>env</name>
  115. <value>release</value>
  116. </property>
  117. </activation>
  118. <build>
  119. <plugins>
  120. <plugin>
  121. <artifactId>maven-assembly-plugin</artifactId>
  122. <configuration>
  123. <!-- 发布模式使用的maven assembly插件描述文件 -->
  124. <descriptors>
  125. <descriptor>${basedir}/src/main/assembly/release.xml</descriptor>
  126. </descriptors>
  127. <!-- 如果一个应用的包含多个deploy模块,如果使用同样的包名, 如果把它们复制的一个目录中可能会失败,所以包名加了 artifactId以示区分 -->
  128. <finalName>${project.artifactId}-${project.version}</finalName>
  129. <!-- scm 要求 release 模式打出的包放到顶级目录下的target子目录中 -->
  130. <outputDirectory>${project.parent.build.directory}</outputDirectory>
  131. </configuration>
  132. </plugin>
  133. </plugins>
  134. </build>
  135. </profile>
  136. </profiles>
  137. </project>