pom.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  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>com.hcloud.microserver</groupId>
  7. <artifactId>common-parent</artifactId>
  8. <version>0.0.1-SNAPSHOT</version>
  9. <relativePath>../common-parent/pom.xml</relativePath>
  10. </parent>
  11. <groupId>com.hcloud.miroserver</groupId>
  12. <artifactId>goods-manage-service</artifactId>
  13. <version>${goods.managerclient.version}</version>
  14. <packaging>jar</packaging>
  15. <name>goods-manage-service</name>
  16. <description>Demo project for Spring Boot</description>
  17. <dependencies>
  18. <dependency>
  19. <groupId>com.hcloud.microserver</groupId>
  20. <artifactId>common-core</artifactId>
  21. <version>${common.core.version}</version>
  22. </dependency>
  23. <dependency>
  24. <groupId>com.hcloud.microserver</groupId>
  25. <artifactId>goods-manage-client</artifactId>
  26. <version>${goods.managerclient.version}</version>
  27. </dependency>
  28. <dependency>
  29. <groupId>org.springframework.boot</groupId>
  30. <artifactId>spring-boot-starter</artifactId>
  31. </dependency>
  32. <dependency>
  33. <groupId>org.mybatis</groupId>
  34. <artifactId>mybatis</artifactId>
  35. </dependency>
  36. <dependency>
  37. <groupId>org.mybatis.spring.boot</groupId>
  38. <artifactId>mybatis-spring-boot-starter</artifactId>
  39. </dependency>
  40. <dependency>
  41. <groupId>org.springframework.cloud</groupId>
  42. <artifactId>spring-cloud-starter-eureka</artifactId>
  43. </dependency>
  44. <!--druid -->
  45. <dependency>
  46. <groupId>com.alibaba</groupId>
  47. <artifactId>druid</artifactId>
  48. </dependency>
  49. <!-- 分页支持pageHelper -->
  50. <dependency>
  51. <groupId>com.github.pagehelper</groupId>
  52. <artifactId>pagehelper-spring-boot-starter</artifactId>
  53. </dependency>
  54. <dependency>
  55. <groupId>org.mybatis.spring.boot</groupId>
  56. <artifactId>mybatis-spring-boot-starter</artifactId>
  57. </dependency>
  58. <dependency>
  59. <groupId>mysql</groupId>
  60. <artifactId>mysql-connector-java</artifactId>
  61. </dependency>
  62. <dependency>
  63. <groupId>org.springframework.boot</groupId>
  64. <artifactId>spring-boot-starter-cache</artifactId>
  65. <version>1.5.18.RELEASE</version>
  66. </dependency>
  67. <dependency>
  68. <groupId>org.springframework.boot</groupId>
  69. <artifactId>spring-boot-starter-data-redis</artifactId>
  70. </dependency>
  71. <dependency>
  72. <groupId>org.springframework.cloud</groupId>
  73. <artifactId>spring-cloud-starter-ribbon</artifactId>
  74. </dependency>
  75. <!-- java9+版本以后,JAXB默认没有加载,手动添加jaxb模块 -->
  76. <!-- <dependency>
  77. <groupId>javax.xml.bind</groupId>
  78. <artifactId>jaxb-api</artifactId>
  79. <version>2.2.11</version>
  80. </dependency>
  81. <dependency>
  82. <groupId>com.sun.xml.bind</groupId>
  83. <artifactId>jaxb-core</artifactId>
  84. <version>2.2.11</version>
  85. </dependency>
  86. <dependency>
  87. <groupId>com.sun.xml.bind</groupId>
  88. <artifactId>jaxb-impl</artifactId>
  89. <version>2.2.11</version>
  90. </dependency>
  91. <dependency>
  92. <groupId>javax.activation</groupId>
  93. <artifactId>activation</artifactId>
  94. <version>1.1.1</version>
  95. </dependency> -->
  96. <!-- SpringWeb模块 -->
  97. <!-- dependency>
  98. <groupId>org.springframework</groupId>
  99. <artifactId>spring-web</artifactId>
  100. <version>5.2.1.RELEASE</version>
  101. </dependency>
  102. <dependency>
  103. <groupId>org.springframework.boot</groupId>
  104. <artifactId>spring-boot</artifactId>
  105. <version>1.5.18.RELEASE</version>
  106. </dependency>
  107. <dependency>
  108. <groupId>org.springframework</groupId>
  109. <artifactId>spring-expression</artifactId>
  110. <version>5.2.1.RELEASE</version>
  111. </dependency> -->
  112. </dependencies>
  113. <!-- <build>
  114. <plugins>
  115. 打JAR包
  116. <plugin>
  117. <groupId>org.apache.maven.plugins</groupId>
  118. <artifactId>maven-jar-plugin</artifactId>
  119. <configuration>
  120. 不打包资源文件(配置文件和依赖包分开)
  121. <excludes>
  122. <exclude>*.**</exclude>
  123. <exclude>*/*.xml</exclude>
  124. </excludes>
  125. <archive>
  126. <manifest>
  127. <addClasspath>true</addClasspath>
  128. MANIFEST.MF 中 Class-Path 加入前缀
  129. <classpathPrefix>lib/</classpathPrefix>
  130. jar包不包含唯一版本标识
  131. <useUniqueVersions>false</useUniqueVersions>
  132. 指定入口类
  133. <mainClass>com.hcloud.microservice.goods.GoodsManageServiceApplication</mainClass>
  134. </manifest>
  135. <manifestEntries>
  136. MANIFEST.MF 中 Class-Path 加入资源文件目录
  137. <Class-Path>./resources/</Class-Path>
  138. </manifestEntries>
  139. </archive>
  140. <outputDirectory>${project.build.directory}</outputDirectory>
  141. </configuration>
  142. </plugin>
  143. 该插件的作用是用于复制依赖的jar包到指定的文件夹里
  144. <plugin>
  145. <groupId>org.apache.maven.plugins</groupId>
  146. <artifactId>maven-dependency-plugin</artifactId>
  147. <executions>
  148. <execution>
  149. <id>copy-dependencies</id>
  150. <phase>package</phase>
  151. <goals>
  152. <goal>copy-dependencies</goal>
  153. </goals>
  154. <configuration>
  155. <outputDirectory>${project.build.directory}/lib/</outputDirectory>
  156. </configuration>
  157. </execution>
  158. </executions>
  159. </plugin>
  160. 该插件的作用是用于复制指定的文件
  161. <plugin>
  162. <artifactId>maven-resources-plugin</artifactId>
  163. <executions>
  164. <execution> 复制配置文件
  165. <id>copy-resources</id>
  166. <phase>package</phase>
  167. <goals>
  168. <goal>copy-resources</goal>
  169. </goals>
  170. <configuration>
  171. <resources>
  172. <resource>
  173. <directory>src/main/resources</directory>
  174. <includes>
  175. <include>*.properties</include>
  176. </includes>
  177. </resource>
  178. </resources>
  179. <outputDirectory>${project.build.directory}/resources</outputDirectory>
  180. </configuration>
  181. </execution>
  182. </executions>
  183. </plugin>
  184. SpringBoot 打包插件,把 maven-jar-plugin 打成的jar包重新打成可运行jar包
  185. <plugin>
  186. <groupId>org.springframework.boot</groupId>
  187. <artifactId>spring-boot-maven-plugin</artifactId>
  188. <configuration>
  189. 重写包含依赖,包含不存在的依赖,jar里没有pom里的依赖
  190. <includes>
  191. <include>
  192. <groupId>null</groupId>
  193. <artifactId>null</artifactId>
  194. </include>
  195. </includes>
  196. <layout>ZIP</layout>
  197. 使用外部配置文件,jar包里没有资源文件
  198. <addResources>true</addResources>
  199. <outputDirectory>${project.build.directory}/resources</outputDirectory>
  200. </configuration>
  201. <executions>
  202. <execution>
  203. <goals>
  204. <goal>repackage</goal>
  205. </goals>
  206. <configuration>
  207. 配置jar包特殊标识 配置后,保留原文件,生成新文件 *-run.jar
  208. 配置jar包特殊标识 不配置,原文件命名为 *.jar.original,生成新文件 *.jar
  209. <classifier>run</classifier>
  210. </configuration>
  211. </execution>
  212. </executions>
  213. </plugin>
  214. <plugin>
  215. <groupId>org.springframework.boot</groupId>
  216. <artifactId>spring-boot-maven-plugin</artifactId>
  217. </plugin>
  218. <plugin>
  219. <groupId>org.apache.maven.plugins</groupId>
  220. <artifactId>maven-surefire-plugin</artifactId>
  221. <version>2.18.1</version>
  222. <configuration>
  223. <skipTests>true</skipTests>
  224. </configuration>
  225. </plugin>
  226. <plugin>
  227. <groupId>org.mybatis.generator</groupId>
  228. <artifactId>mybatis-generator-maven-plugin</artifactId>
  229. <version>1.3.5</version>
  230. <dependencies>
  231. <dependency>
  232. <groupId> mysql</groupId>
  233. <artifactId> mysql-connector-java</artifactId>
  234. <version>5.1.39</version>
  235. </dependency>
  236. <dependency>
  237. <groupId>org.mybatis.generator</groupId>
  238. <artifactId>mybatis-generator-core</artifactId>
  239. <version>1.3.5</version>
  240. </dependency>
  241. </dependencies>
  242. <executions>
  243. <execution>
  244. <id>Generate MyBatis Artifacts</id>
  245. <phase>deploy</phase>
  246. <goals>
  247. <goal>generate</goal>
  248. </goals>
  249. </execution>
  250. </executions>
  251. <configuration>
  252. 允许移动生成的文件
  253. <verbose>true</verbose>
  254. 是否覆盖
  255. <overwrite>true</overwrite>
  256. 自动生成的配置
  257. <configurationFile>src/main/resources/generatorConfig.xml</configurationFile>
  258. </configuration>
  259. </plugin>
  260. </plugins>
  261. </build> -->
  262. <build>
  263. <plugins>
  264. <plugin>
  265. <groupId>org.springframework.boot</groupId>
  266. <artifactId>spring-boot-maven-plugin</artifactId>
  267. </plugin>
  268. <plugin>
  269. <groupId>org.apache.maven.plugins</groupId>
  270. <artifactId>maven-surefire-plugin</artifactId>
  271. <version>2.18.1</version>
  272. <configuration>
  273. <skipTests>true</skipTests>
  274. </configuration>
  275. </plugin>
  276. <plugin>
  277. <groupId>org.mybatis.generator</groupId>
  278. <artifactId>mybatis-generator-maven-plugin</artifactId>
  279. <version>1.3.5</version>
  280. <dependencies>
  281. <dependency>
  282. <groupId> mysql</groupId>
  283. <artifactId> mysql-connector-java</artifactId>
  284. <version>5.1.39</version>
  285. </dependency>
  286. <dependency>
  287. <groupId>org.mybatis.generator</groupId>
  288. <artifactId>mybatis-generator-core</artifactId>
  289. <version>1.3.5</version>
  290. </dependency>
  291. </dependencies>
  292. <executions>
  293. <execution>
  294. <id>Generate MyBatis Artifacts</id>
  295. <phase>deploy</phase>
  296. <goals>
  297. <goal>generate</goal>
  298. </goals>
  299. </execution>
  300. </executions>
  301. <configuration>
  302. <!--允许移动生成的文件 -->
  303. <verbose>true</verbose>
  304. <!-- 是否覆盖 -->
  305. <overwrite>true</overwrite>
  306. <!-- 自动生成的配置 -->
  307. <configurationFile>src/main/resources/generatorConfig.xml</configurationFile>
  308. </configuration>
  309. </plugin>
  310. </plugins>
  311. </build>
  312. </project>