You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

pom.xml 6.0 kB

5 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. <parent>
  6. <artifactId>docker</artifactId>
  7. <groupId>com.jd.blockchain</groupId>
  8. <version>1.5.0.RELEASE</version>
  9. </parent>
  10. <modelVersion>4.0.0</modelVersion>
  11. <artifactId>docker-demo</artifactId>
  12. <dependencies>
  13. <dependency>
  14. <groupId>com.jd.blockchain</groupId>
  15. <artifactId>docker-sdk</artifactId>
  16. <version>${project.version}</version>
  17. </dependency>
  18. </dependencies>
  19. <build>
  20. <finalName>jdchain-demo</finalName>
  21. <plugins>
  22. <plugin>
  23. <groupId>org.apache.maven.plugins</groupId>
  24. <artifactId>maven-compiler-plugin</artifactId>
  25. <configuration>
  26. <source>1.8</source>
  27. <target>1.8</target>
  28. <encoding>UTF-8</encoding>
  29. <optimize>false</optimize>
  30. <debug>true</debug>
  31. <showDeprecation>false</showDeprecation>
  32. <showWarnings>false</showWarnings>
  33. </configuration>
  34. </plugin>
  35. <!-- <plugin>-->
  36. <!-- <groupId>org.apache.maven.plugins</groupId>-->
  37. <!-- <artifactId>maven-dependency-plugin</artifactId>-->
  38. <!-- <executions>-->
  39. <!-- <execution>-->
  40. <!-- <id>copy-dependencies</id>-->
  41. <!-- <phase>package</phase>-->
  42. <!-- <goals>-->
  43. <!-- <goal>copy-dependencies</goal>-->
  44. <!-- </goals>-->
  45. <!-- <configuration>-->
  46. <!-- <outputDirectory>${project.build.directory}/dependencies</outputDirectory>-->
  47. <!-- <excludeTransitive>false</excludeTransitive>-->
  48. <!-- <stripVersion>false</stripVersion>-->
  49. <!-- <includeScope>runtime</includeScope>-->
  50. <!-- </configuration>-->
  51. <!-- </execution>-->
  52. <!-- </executions>-->
  53. <!-- </plugin>-->
  54. <plugin>
  55. <artifactId>maven-resources-plugin</artifactId>
  56. <version>3.0.2</version>
  57. <executions>
  58. <execution>
  59. <id>copy-resources</id>
  60. <phase>validate</phase>
  61. <goals>
  62. <goal>copy-resources</goal>
  63. </goals>
  64. <configuration>
  65. <!-- 将资源文件拷贝到config目录下 -->
  66. <encoding>UTF-8</encoding>
  67. <outputDirectory>${project.basedir}/src/main/docker/zip</outputDirectory>
  68. <overwrite>false</overwrite>
  69. <resources>
  70. <resource>
  71. <directory>${project.basedir}/../../deploy-peer/target/</directory>
  72. <filtering>false</filtering>
  73. <includes>
  74. <include>jdchain-peer-${project.version}.zip</include>
  75. </includes>
  76. </resource>
  77. <resource>
  78. <directory>${project.basedir}/../../deploy-gateway/target/</directory>
  79. <filtering>false</filtering>
  80. <includes>
  81. <include>jdchain-gateway-${project.version}.zip</include>
  82. </includes>
  83. </resource>
  84. <!-- sdk -->
  85. <resource>
  86. <directory>${project.basedir}/../docker-sdk/target/</directory>
  87. <filtering>false</filtering>
  88. <includes>
  89. <include>docker-sdk-${project.version}.jar</include>
  90. </includes>
  91. </resource>
  92. </resources>
  93. </configuration>
  94. </execution>
  95. </executions>
  96. </plugin>
  97. <!-- 使用Maven插件直接将应用打包为一个Docker镜像 -->
  98. <plugin>
  99. <groupId>com.spotify</groupId>
  100. <artifactId>docker-maven-plugin</artifactId>
  101. <version>1.2.2</version>
  102. <!--将插件绑定在某个phase执行-->
  103. <executions>
  104. <execution>
  105. <id>build-image</id>
  106. <!--将插件绑定在package这个phase上。也就是说,用户只需执行mvn package ,就会自动执行mvn docker:build-->
  107. <phase>package</phase>
  108. <goals>
  109. <goal>build</goal>
  110. </goals>
  111. </execution>
  112. </executions>
  113. <configuration>
  114. <imageName>jdchain-demo</imageName>
  115. <imageTags>
  116. <imageTag>${project.version}</imageTag>
  117. </imageTags>
  118. <!-- 指定 Dockerfile 路径-->
  119. <dockerDirectory>${project.basedir}/target</dockerDirectory>
  120. </configuration>
  121. </plugin>
  122. </plugins>
  123. </build>
  124. </project>