pom.xml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  3. <modelVersion>4.0.0</modelVersion>
  4. <parent>
  5. <groupId>com.uas.ps</groupId>
  6. <artifactId>ps-sync-parent</artifactId>
  7. <version>0.0.1-SNAPSHOT</version>
  8. </parent>
  9. <artifactId>ps-sync-consumer</artifactId>
  10. <packaging>jar</packaging>
  11. <properties>
  12. <docker.plugin.version>0.4.13</docker.plugin.version>
  13. <docker.registry>10.10.100.200:5000</docker.registry>
  14. <docker.directory>${project.build.directory}/generated-docker</docker.directory>
  15. <docker.pushImage>false</docker.pushImage>
  16. </properties>
  17. <dependencies>
  18. <dependency>
  19. <groupId>junit</groupId>
  20. <artifactId>junit</artifactId>
  21. <scope>test</scope>
  22. </dependency>
  23. <dependency>
  24. <groupId>com.uas.ps</groupId>
  25. <artifactId>ps-core</artifactId>
  26. </dependency>
  27. <dependency>
  28. <groupId>com.uas.ps</groupId>
  29. <artifactId>ps-sync-entity</artifactId>
  30. </dependency>
  31. <!-- spring boot -->
  32. <dependency>
  33. <groupId>org.springframework.boot</groupId>
  34. <artifactId>spring-boot-starter-actuator</artifactId>
  35. </dependency>
  36. <dependency>
  37. <groupId>org.springframework.kafka</groupId>
  38. <artifactId>spring-kafka</artifactId>
  39. </dependency>
  40. <dependency>
  41. <groupId>org.springframework.boot</groupId>
  42. <artifactId>spring-boot-starter-jdbc</artifactId>
  43. </dependency>
  44. <dependency>
  45. <groupId>org.springframework.boot</groupId>
  46. <artifactId>spring-boot-configuration-processor</artifactId>
  47. </dependency>
  48. <dependency>
  49. <groupId>mysql</groupId>
  50. <artifactId>mysql-connector-java</artifactId>
  51. </dependency>
  52. <dependency>
  53. <groupId>com.oracle</groupId>
  54. <artifactId>ojdbc6</artifactId>
  55. </dependency>
  56. <dependency>
  57. <groupId>com.alibaba</groupId>
  58. <artifactId>druid</artifactId>
  59. </dependency>
  60. <dependency>
  61. <groupId>com.alibaba</groupId>
  62. <artifactId>fastjson</artifactId>
  63. </dependency>
  64. </dependencies>
  65. <build>
  66. <resources>
  67. <!-- 必须包含这个 -->
  68. <resource>
  69. <directory>${project.basedir}/src/main/resources</directory>
  70. <includes>
  71. <include>**/*</include>
  72. </includes>
  73. </resource>
  74. <!-- 替换Dockerfile占位符 -->
  75. <resource>
  76. <directory>${project.basedir}/src/main/docker</directory>
  77. <filtering>true</filtering>
  78. <includes>
  79. <include>**/Dockerfile</include>
  80. </includes>
  81. <targetPath>${docker.directory}</targetPath>
  82. </resource>
  83. </resources>
  84. <plugins>
  85. <plugin>
  86. <groupId>org.springframework.boot</groupId>
  87. <artifactId>spring-boot-maven-plugin</artifactId>
  88. </plugin>
  89. <plugin>
  90. <groupId>com.spotify</groupId>
  91. <artifactId>docker-maven-plugin</artifactId>
  92. <version>${docker.plugin.version}</version>
  93. <executions>
  94. <execution>
  95. <id>build-image</id>
  96. <phase>package</phase>
  97. <goals>
  98. <goal>build</goal>
  99. </goals>
  100. </execution>
  101. </executions>
  102. <configuration>
  103. <registryUrl>${docker.registry}</registryUrl>
  104. <!-- <dockerHost>${docker.host}</dockerHost>
  105. <baseImage>${docker.registry}/java</baseImage>
  106. <entryPoint>["java", "-jar", "/${project.build.finalName}.jar"]</entryPoint>
  107. -->
  108. <dockerDirectory>${docker.directory}</dockerDirectory>
  109. <imageName>${docker.registry}/${project.artifactId}</imageName>
  110. <pushImage>${docker.pushImage}</pushImage>
  111. <resources>
  112. <resource>
  113. <targetPath>/</targetPath>
  114. <directory>${project.build.directory}</directory>
  115. <include>${project.build.finalName}.jar</include>
  116. </resource>
  117. </resources>
  118. </configuration>
  119. </plugin>
  120. </plugins>
  121. </build>
  122. </project>