pom.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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>0.9.0.1</version>
  31. <exclusions>
  32. <exclusion>
  33. <groupId>org.slf4j</groupId>
  34. <artifactId>slf4j-log4j12</artifactId>
  35. </exclusion>
  36. </exclusions>
  37. </dependency>
  38. </dependencies>
  39. <build>
  40. <plugins>
  41. <!-- deploy模块的packaging通常是jar,如果项目中没有java 源代码或资源文件,加上这一段配置使项目能通过构建 -->
  42. <plugin>
  43. <artifactId>maven-jar-plugin</artifactId>
  44. <configuration>
  45. <archive>
  46. <addMavenDescriptor>true</addMavenDescriptor>
  47. </archive>
  48. <excludes>
  49. <exclude>**/logback.xml</exclude>
  50. <exclude>**/canal.properties</exclude>
  51. <exclude>**/spring/**</exclude>
  52. <exclude>**/example/**</exclude>
  53. <exclude>**/kafka.yml</exclude>
  54. </excludes>
  55. </configuration>
  56. </plugin>
  57. <plugin>
  58. <groupId>org.apache.maven.plugins</groupId>
  59. <artifactId>maven-assembly-plugin</artifactId>
  60. <!-- 这是最新版本,推荐使用这个版本 -->
  61. <version>2.2.1</version>
  62. <executions>
  63. <execution>
  64. <id>assemble</id>
  65. <goals>
  66. <goal>single</goal>
  67. </goals>
  68. <phase>package</phase>
  69. </execution>
  70. </executions>
  71. <configuration>
  72. <appendAssemblyId>false</appendAssemblyId>
  73. <attach>false</attach>
  74. </configuration>
  75. </plugin>
  76. </plugins>
  77. </build>
  78. <profiles>
  79. <profile>
  80. <id>dev</id>
  81. <activation>
  82. <activeByDefault>true</activeByDefault>
  83. <property>
  84. <name>env</name>
  85. <value>!release</value>
  86. </property>
  87. </activation>
  88. <build>
  89. <plugins>
  90. <plugin>
  91. <artifactId>maven-assembly-plugin</artifactId>
  92. <configuration>
  93. <!-- maven assembly插件需要一个描述文件 来告诉插件包的结构以及打包所需的文件来自哪里 -->
  94. <descriptors>
  95. <descriptor>${basedir}/src/main/assembly/dev.xml</descriptor>
  96. </descriptors>
  97. <finalName>canal</finalName>
  98. <outputDirectory>${project.build.directory}</outputDirectory>
  99. </configuration>
  100. </plugin>
  101. </plugins>
  102. </build>
  103. </profile>
  104. <profile>
  105. <id>release</id>
  106. <activation>
  107. <property>
  108. <name>env</name>
  109. <value>release</value>
  110. </property>
  111. </activation>
  112. <build>
  113. <plugins>
  114. <plugin>
  115. <artifactId>maven-assembly-plugin</artifactId>
  116. <configuration>
  117. <!-- 发布模式使用的maven assembly插件描述文件 -->
  118. <descriptors>
  119. <descriptor>${basedir}/src/main/assembly/release.xml</descriptor>
  120. </descriptors>
  121. <!-- 如果一个应用的包含多个deploy模块,如果使用同样的包名, 如果把它们复制的一个目录中可能会失败,所以包名加了 artifactId以示区分 -->
  122. <finalName>${project.artifactId}-${project.version}</finalName>
  123. <!-- scm 要求 release 模式打出的包放到顶级目录下的target子目录中 -->
  124. <outputDirectory>${project.parent.build.directory}</outputDirectory>
  125. </configuration>
  126. </plugin>
  127. </plugins>
  128. </build>
  129. </profile>
  130. </profiles>
  131. </project>