pom.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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.3-SNAPSHOT</version>
  7. <relativePath>../pom.xml</relativePath>
  8. </parent>
  9. <groupId>com.alibaba.otter</groupId>
  10. <artifactId>canal.example</artifactId>
  11. <packaging>jar</packaging>
  12. <name>canal example module for otter ${project.version}</name>
  13. <dependencies>
  14. <dependency>
  15. <groupId>com.alibaba.otter</groupId>
  16. <artifactId>canal.client</artifactId>
  17. <version>${project.version}</version>
  18. </dependency>
  19. <dependency>
  20. <groupId>com.alibaba.otter</groupId>
  21. <artifactId>canal.protocol</artifactId>
  22. <version>${project.version}</version>
  23. </dependency>
  24. <dependency>
  25. <groupId>com.alibaba</groupId>
  26. <artifactId>druid</artifactId>
  27. </dependency>
  28. <dependency>
  29. <groupId>mysql</groupId>
  30. <artifactId>mysql-connector-java</artifactId>
  31. </dependency>
  32. <dependency>
  33. <groupId>org.apache.ddlutils</groupId>
  34. <artifactId>ddlutils</artifactId>
  35. <version>1.0</version>
  36. <exclusions>
  37. <exclusion>
  38. <groupId>commons-beanutils</groupId>
  39. <artifactId>commons-beanutils-core</artifactId>
  40. </exclusion>
  41. <exclusion>
  42. <groupId>commons-lang</groupId>
  43. <artifactId>commons-lang</artifactId>
  44. </exclusion>
  45. <exclusion>
  46. <groupId>commons-dbcp</groupId>
  47. <artifactId>commons-dbcp</artifactId>
  48. </exclusion>
  49. <exclusion>
  50. <groupId>commons-pool</groupId>
  51. <artifactId>commons-pool</artifactId>
  52. </exclusion>
  53. <exclusion>
  54. <groupId>commons-logging</groupId>
  55. <artifactId>commons-logging-api</artifactId>
  56. </exclusion>
  57. <exclusion>
  58. <groupId>dom4j</groupId>
  59. <artifactId>dom4j</artifactId>
  60. </exclusion>
  61. <exclusion>
  62. <groupId>stax</groupId>
  63. <artifactId>stax-api</artifactId>
  64. </exclusion>
  65. <exclusion>
  66. <groupId>commons-collections</groupId>
  67. <artifactId>commons-collections</artifactId>
  68. </exclusion>
  69. <exclusion>
  70. <groupId>commons-digester</groupId>
  71. <artifactId>commons-digester</artifactId>
  72. </exclusion>
  73. <exclusion>
  74. <groupId>commons-betwixt</groupId>
  75. <artifactId>commons-betwixt</artifactId>
  76. </exclusion>
  77. </exclusions>
  78. </dependency>
  79. <dependency>
  80. <groupId>org.apache.commons</groupId>
  81. <artifactId>commons-pool2</artifactId>
  82. <version>2.5.0</version>
  83. </dependency>
  84. <dependency>
  85. <groupId>commons-beanutils</groupId>
  86. <artifactId>commons-beanutils</artifactId>
  87. <version>1.8.2</version>
  88. </dependency>
  89. <dependency>
  90. <groupId>org.apache.commons</groupId>
  91. <artifactId>commons-lang3</artifactId>
  92. <version>3.7</version>
  93. </dependency>
  94. <dependency>
  95. <groupId>commons-collections</groupId>
  96. <artifactId>commons-collections</artifactId>
  97. <version>3.2</version>
  98. </dependency>
  99. <!-- test dependency -->
  100. <dependency>
  101. <groupId>junit</groupId>
  102. <artifactId>junit</artifactId>
  103. <scope>test</scope>
  104. </dependency>
  105. </dependencies>
  106. <build>
  107. <plugins>
  108. <!-- deploy模块的packaging通常是jar,如果项目中没有java 源代码或资源文件,加上这一段配置使项目能通过构建 -->
  109. <plugin>
  110. <groupId>org.apache.maven.plugins</groupId>
  111. <artifactId>maven-jar-plugin</artifactId>
  112. <version>2.5</version>
  113. <configuration>
  114. <archive>
  115. <addMavenDescriptor>true</addMavenDescriptor>
  116. </archive>
  117. </configuration>
  118. </plugin>
  119. <plugin>
  120. <groupId>org.apache.maven.plugins</groupId>
  121. <artifactId>maven-assembly-plugin</artifactId>
  122. <!-- 这是最新版本,推荐使用这个版本 -->
  123. <version>2.2.1</version>
  124. <executions>
  125. <execution>
  126. <id>assemble</id>
  127. <goals>
  128. <goal>single</goal>
  129. </goals>
  130. <phase>package</phase>
  131. </execution>
  132. </executions>
  133. <configuration>
  134. <appendAssemblyId>false</appendAssemblyId>
  135. <attach>false</attach>
  136. </configuration>
  137. </plugin>
  138. </plugins>
  139. </build>
  140. <profiles>
  141. <profile>
  142. <id>dev</id>
  143. <activation>
  144. <activeByDefault>true</activeByDefault>
  145. <property>
  146. <name>env</name>
  147. <value>!release</value>
  148. </property>
  149. </activation>
  150. <build>
  151. <plugins>
  152. <plugin>
  153. <artifactId>maven-assembly-plugin</artifactId>
  154. <configuration>
  155. <!-- maven assembly插件需要一个描述文件 来告诉插件包的结构以及打包所需的文件来自哪里 -->
  156. <descriptors>
  157. <descriptor>${basedir}/src/main/assembly/dev.xml</descriptor>
  158. </descriptors>
  159. <finalName>canal-example</finalName>
  160. <outputDirectory>${project.build.directory}</outputDirectory>
  161. </configuration>
  162. </plugin>
  163. </plugins>
  164. </build>
  165. </profile>
  166. <profile>
  167. <id>release</id>
  168. <activation>
  169. <property>
  170. <name>env</name>
  171. <value>release</value>
  172. </property>
  173. </activation>
  174. <build>
  175. <plugins>
  176. <plugin>
  177. <artifactId>maven-assembly-plugin</artifactId>
  178. <configuration>
  179. <!-- 发布模式使用的maven assembly插件描述文件 -->
  180. <descriptors>
  181. <descriptor>${basedir}/src/main/assembly/release.xml</descriptor>
  182. </descriptors>
  183. <!-- 如果一个应用的包含多个deploy模块,如果使用同样的包名, 如果把它们复制的一个目录中可能会失败,所以包名加了 artifactId以示区分 -->
  184. <finalName>${project.artifactId}-${project.version}</finalName>
  185. <!-- scm 要求 release 模式打出的包放到顶级目录下的target子目录中 -->
  186. <outputDirectory>${project.parent.build.directory}</outputDirectory>
  187. </configuration>
  188. </plugin>
  189. </plugins>
  190. </build>
  191. </profile>
  192. </profiles>
  193. </project>