pom.xml 12 KB

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