pom.xml 4.3 KB

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