pom.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  4. <modelVersion>4.0.0</modelVersion>
  5. <parent>
  6. <groupId>org.springframework.boot</groupId>
  7. <artifactId>spring-boot-starter-parent</artifactId>
  8. <version>2.1.3.RELEASE</version>
  9. <relativePath/> <!-- lookup parent from repository -->
  10. </parent>
  11. <groupId>com.dgtis</groupId>
  12. <artifactId>primary-school</artifactId>
  13. <version>0.0.1-SNAPSHOT</version>
  14. <name>primary-school</name>
  15. <description>hengshui city primary-school information</description>
  16. <properties>
  17. <java.version>1.8</java.version>
  18. </properties>
  19. <dependencies>
  20. <dependency>
  21. <groupId>org.springframework.boot</groupId>
  22. <artifactId>spring-boot-starter-data-jpa</artifactId>
  23. </dependency>
  24. <dependency>
  25. <groupId>org.springframework.boot</groupId>
  26. <artifactId>spring-boot-starter-data-rest</artifactId>
  27. </dependency>
  28. <dependency>
  29. <groupId>org.springframework.boot</groupId>
  30. <artifactId>spring-boot-starter-thymeleaf</artifactId>
  31. </dependency>
  32. <dependency>
  33. <groupId>org.projectlombok</groupId>
  34. <artifactId>lombok</artifactId>
  35. </dependency>
  36. <dependency>
  37. <groupId>com.alibaba</groupId>
  38. <artifactId>druid-spring-boot-starter</artifactId>
  39. <version>1.1.10</version>
  40. </dependency>
  41. <dependency>
  42. <groupId>mysql</groupId>
  43. <artifactId>mysql-connector-java</artifactId>
  44. <scope>runtime</scope>
  45. </dependency>
  46. <dependency>
  47. <groupId>org.springframework.boot</groupId>
  48. <artifactId>spring-boot-starter-test</artifactId>
  49. <scope>test</scope>
  50. </dependency>
  51. </dependencies>
  52. <build>
  53. <plugins>
  54. <plugin>
  55. <groupId>org.springframework.boot</groupId>
  56. <artifactId>spring-boot-maven-plugin</artifactId>
  57. </plugin>
  58. <!--使用docker-maven-plugin插件-->
  59. <plugin>
  60. <groupId>com.spotify</groupId>
  61. <artifactId>docker-maven-plugin</artifactId>
  62. <version>1.0.0</version>
  63. <!--将插件绑定在某个phase执行-->
  64. <executions>
  65. <execution>
  66. <id>build-image</id>
  67. <!--将插件绑定在package这个phase上。也就是说,用户只需执行mvn package ,就会自动执行mvn docker:build-->
  68. <phase>package</phase>
  69. <goals>
  70. <goal>build</goal>
  71. </goals>
  72. </execution>
  73. </executions>
  74. <configuration>
  75. <!--指定生成的镜像名-->
  76. <imageName>hsdata/${project.artifactId}</imageName>
  77. <!--指定标签-->
  78. <imageTags>
  79. <imageTag>latest</imageTag>
  80. </imageTags>
  81. <!-- 指定 Dockerfile 路径-->
  82. <dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
  83. <!--指定远程 docker api地址-->
  84. <dockerHost>http://39.105.217.215:2375</dockerHost>
  85. <!-- 这里是复制 jar 包到 docker 容器指定目录配置 -->
  86. <resources>
  87. <resource>
  88. <targetPath>/</targetPath>
  89. <!--jar 包所在的路径 此处配置的 即对应 target 目录-->
  90. <directory>${project.build.directory}</directory>
  91. <!-- 需要包含的 jar包 ,这里对应的是 Dockerfile中添加的文件名 -->
  92. <include>${project.build.finalName}.jar</include>
  93. </resource>
  94. </resources>
  95. </configuration>
  96. </plugin>
  97. </plugins>
  98. </build>
  99. </project>