pom.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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. <groupId>com.jiashun.gao</groupId>
  6. <artifactId>file-collect</artifactId>
  7. <version>1.0.0-SNAPSHOT</version>
  8. <name>file-collect</name>
  9. <description>file-collect project</description>
  10. <properties>
  11. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  12. <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  13. <java.version>1.8</java.version>
  14. <skipTests>true</skipTests>
  15. <docker.host>http://192.168.3.101:2375</docker.host>
  16. <docker.maven.plugin.version>1.2.2</docker.maven.plugin.version>
  17. <docker.image.prefix>gaojiashun</docker.image.prefix>
  18. <druid.version>1.1.10</druid.version>
  19. <hutool.version>4.5.7</hutool.version>
  20. <swagger2.version>2.9.2</swagger2.version>
  21. <swagger-models.version>1.6.0</swagger-models.version>
  22. <swagger-annotations.version>1.6.0</swagger-annotations.version>
  23. <mysql-connector.version>8.0.16</mysql-connector.version>
  24. <jjwt.version>0.9.0</jjwt.version>
  25. <mybatis-plus.version>3.3.2</mybatis-plus.version>
  26. <velocity.version>2.2</velocity.version>
  27. </properties>
  28. <parent>
  29. <groupId>org.springframework.boot</groupId>
  30. <artifactId>spring-boot-starter-parent</artifactId>
  31. <version>2.3.0.RELEASE</version>
  32. <relativePath/> <!-- lookup parent from repository -->
  33. </parent>
  34. <dependencies>
  35. <!--SpringBoot通用依赖模块-->
  36. <dependency>
  37. <groupId>org.springframework.boot</groupId>
  38. <artifactId>spring-boot-starter-web</artifactId>
  39. </dependency>
  40. <dependency>
  41. <groupId>org.springframework.boot</groupId>
  42. <artifactId>spring-boot-starter-actuator</artifactId>
  43. </dependency>
  44. <dependency>
  45. <groupId>org.springframework.boot</groupId>
  46. <artifactId>spring-boot-starter-aop</artifactId>
  47. </dependency>
  48. <dependency>
  49. <groupId>org.springframework.boot</groupId>
  50. <artifactId>spring-boot-starter-test</artifactId>
  51. <scope>test</scope>
  52. </dependency>
  53. <!--SpringBoot校验框架-->
  54. <dependency>
  55. <groupId>org.springframework.boot</groupId>
  56. <artifactId>spring-boot-starter-validation</artifactId>
  57. </dependency>
  58. <!--集成druid连接池-->
  59. <dependency>
  60. <groupId>com.alibaba</groupId>
  61. <artifactId>druid-spring-boot-starter</artifactId>
  62. <version>${druid.version}</version>
  63. </dependency>
  64. <!--Mysql数据库驱动-->
  65. <dependency>
  66. <groupId>mysql</groupId>
  67. <artifactId>mysql-connector-java</artifactId>
  68. <version>${mysql-connector.version}</version>
  69. </dependency>
  70. <!--Swagger-UI API文档生产工具-->
  71. <dependency>
  72. <groupId>io.springfox</groupId>
  73. <artifactId>springfox-swagger2</artifactId>
  74. <version>${swagger2.version}</version>
  75. </dependency>
  76. <dependency>
  77. <groupId>io.springfox</groupId>
  78. <artifactId>springfox-swagger-ui</artifactId>
  79. <version>${swagger2.version}</version>
  80. </dependency>
  81. <!--解决Swagger 2.9.2版本NumberFormatException-->
  82. <dependency>
  83. <groupId>io.swagger</groupId>
  84. <artifactId>swagger-models</artifactId>
  85. <version>${swagger-models.version}</version>
  86. </dependency>
  87. <dependency>
  88. <groupId>io.swagger</groupId>
  89. <artifactId>swagger-annotations</artifactId>
  90. <version>${swagger-annotations.version}</version>
  91. </dependency>
  92. <!--redis依赖配置-->
  93. <dependency>
  94. <groupId>org.springframework.boot</groupId>
  95. <artifactId>spring-boot-starter-data-redis</artifactId>
  96. </dependency>
  97. <!--SpringSecurity依赖配置-->
  98. <!--SpringSecurity依赖配置-->
  99. <dependency>
  100. <groupId>org.springframework.boot</groupId>
  101. <artifactId>spring-boot-starter-security</artifactId>
  102. </dependency>
  103. <!--Hutool Java工具包-->
  104. <dependency>
  105. <groupId>cn.hutool</groupId>
  106. <artifactId>hutool-all</artifactId>
  107. <version>${hutool.version}</version>
  108. </dependency>
  109. <!--JWT(Json Web Token)登录支持-->
  110. <dependency>
  111. <groupId>io.jsonwebtoken</groupId>
  112. <artifactId>jjwt</artifactId>
  113. <version>${jjwt.version}</version>
  114. </dependency>
  115. <!--lombok依赖-->
  116. <dependency>
  117. <groupId>org.projectlombok</groupId>
  118. <artifactId>lombok</artifactId>
  119. <optional>true</optional>
  120. </dependency>
  121. <!--SpringBoot配置处理-->
  122. <dependency>
  123. <groupId>org.springframework.boot</groupId>
  124. <artifactId>spring-boot-configuration-processor</artifactId>
  125. <optional>true</optional>
  126. </dependency>
  127. <!--MyBatis Plus 依赖-->
  128. <dependency>
  129. <groupId>com.baomidou</groupId>
  130. <artifactId>mybatis-plus-boot-starter</artifactId>
  131. <version>${mybatis-plus.version}</version>
  132. </dependency>
  133. <!--MyBatis Plus 代码生成器-->
  134. <dependency>
  135. <groupId>com.baomidou</groupId>
  136. <artifactId>mybatis-plus-generator</artifactId>
  137. <version>${mybatis-plus.version}</version>
  138. </dependency>
  139. <!--Velocity模板引擎-->
  140. <dependency>
  141. <groupId>org.apache.velocity</groupId>
  142. <artifactId>velocity-engine-core</artifactId>
  143. <version>${velocity.version}</version>
  144. </dependency>
  145. <!-- https://mvnrepository.com/artifact/com.alibaba/easyexcel -->
  146. <dependency>
  147. <groupId>com.alibaba</groupId>
  148. <artifactId>easyexcel</artifactId>
  149. <version>2.2.6</version>
  150. </dependency>
  151. <!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
  152. <dependency>
  153. <groupId>org.apache.httpcomponents</groupId>
  154. <artifactId>httpclient</artifactId>
  155. <version>4.5.13</version>
  156. </dependency>
  157. <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-compress -->
  158. <dependency>
  159. <groupId>org.apache.commons</groupId>
  160. <artifactId>commons-compress</artifactId>
  161. <version>1.20</version>
  162. </dependency>
  163. <!-- https://mvnrepository.com/artifact/com.alibaba.cloud/spring-cloud-starter-alibaba-nacos-config -->
  164. <dependency>
  165. <groupId>com.alibaba.cloud</groupId>
  166. <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
  167. <version>2.2.5.RELEASE</version>
  168. </dependency>
  169. </dependencies>
  170. <build>
  171. <plugins>
  172. <!-- 基于maven-jar-plugin插件实现把依赖jar定义写入输出jar的META-INFO/MANIFEST文件 -->
  173. <plugin>
  174. <groupId>org.apache.maven.plugins</groupId>
  175. <artifactId>maven-jar-plugin</artifactId>
  176. <configuration>
  177. <archive>
  178. <manifest>
  179. <addClasspath>true</addClasspath>
  180. <classpathPrefix>lib/</classpathPrefix>
  181. <useUniqueVersions>false</useUniqueVersions>
  182. </manifest>
  183. </archive>
  184. </configuration>
  185. </plugin>
  186. <!-- 拷贝项目所有依赖jar文件到构建lib目录下 -->
  187. <plugin>
  188. <groupId>org.apache.maven.plugins</groupId>
  189. <artifactId>maven-dependency-plugin</artifactId>
  190. <executions>
  191. <execution>
  192. <id>copy-dependencies</id>
  193. <phase>package</phase>
  194. <goals>
  195. <goal>copy-dependencies</goal>
  196. </goals>
  197. <configuration>
  198. <!--
  199. 各子模块按照实际层级定义各模块对应的属性值,检查所有微服务模块依赖jar文件合并复制到同一个目录
  200. 详见各子模块中 boot-jar-output 属性定义
  201. -->
  202. <outputDirectory>${project.build.directory}/lib</outputDirectory>
  203. <excludeTransitive>false</excludeTransitive>
  204. <stripVersion>false</stripVersion>
  205. <silent>false</silent>
  206. </configuration>
  207. </execution>
  208. </executions>
  209. </plugin>
  210. <!-- Spring Boot模块jar构建 -->
  211. <plugin>
  212. <groupId>org.springframework.boot</groupId>
  213. <artifactId>spring-boot-maven-plugin</artifactId>
  214. <configuration>
  215. <includes>
  216. <!-- 不存在的include引用,相当于排除所有maven依赖jar,没有任何三方jar文件打入输出jar -->
  217. <include>
  218. <groupId>null</groupId>
  219. <artifactId>null</artifactId>
  220. </include>
  221. </includes>
  222. <layout>ZIP</layout>
  223. <!--
  224. 基于maven-jar-plugin输出微服务jar文件进行二次spring boot重新打包文件的输出目录
  225. 所有微服务构建输出jar文件统一输出到与lib同一个目录,便于共同引用同一个lib目录
  226. 详见各子模块中boot-jar-output属性定义
  227. -->
  228. <!-- -->
  229. <outputDirectory>${project.build.directory}</outputDirectory>
  230. </configuration>
  231. <executions>
  232. <execution>
  233. <goals>
  234. <goal>repackage</goal>
  235. </goals>
  236. </execution>
  237. </executions>
  238. </plugin>
  239. <plugin>
  240. <groupId>com.spotify</groupId>
  241. <artifactId>dockerfile-maven-plugin</artifactId>
  242. <version>1.4.13</version>
  243. <executions>
  244. <execution>
  245. <id>default</id>
  246. <goals>
  247. <goal>build</goal>
  248. <goal>push</goal>
  249. </goals>
  250. </execution>
  251. </executions>
  252. <configuration>
  253. <repository>${docker.image.prefix}/${project.artifactId}</repository>
  254. <tag>${project.version}</tag>
  255. <buildArgs>
  256. <JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
  257. </buildArgs>
  258. </configuration>
  259. </plugin>
  260. <!-- <plugin>-->
  261. <!-- <groupId>com.spotify</groupId>-->
  262. <!-- <artifactId>docker-maven-plugin</artifactId>-->
  263. <!-- <version>${docker.maven.plugin.version}</version>-->
  264. <!-- <executions>-->
  265. <!-- <execution>-->
  266. <!-- <id>build-image</id>-->
  267. <!-- <phase>package</phase>-->
  268. <!-- <goals>-->
  269. <!-- <goal>build</goal>-->
  270. <!-- </goals>-->
  271. <!-- </execution>-->
  272. <!-- </executions>-->
  273. <!-- <configuration>-->
  274. <!-- <imageName>file-collect/${project.artifactId}:${project.version}</imageName>-->
  275. <!-- <dockerHost>${docker.host}</dockerHost>-->
  276. <!-- <baseImage>java:8</baseImage>-->
  277. <!-- <entryPoint>["java", "-jar","/${project.build.finalName}.jar"]-->
  278. <!-- </entryPoint>-->
  279. <!-- <resources>-->
  280. <!-- <resource>-->
  281. <!-- <targetPath>/</targetPath>-->
  282. <!-- <directory>${project.build.directory}</directory>-->
  283. <!-- <include>${project.build.finalName}.jar</include>-->
  284. <!-- </resource>-->
  285. <!-- </resources>-->
  286. <!-- </configuration>-->
  287. <!-- </plugin>-->
  288. </plugins>
  289. </build>
  290. </project>