pom.xml 3.5 KB

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