pom.xml 3.8 KB

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