pom.xml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
  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.hcloud.microserver</groupId>
  6. <artifactId>sys-manager-service</artifactId>
  7. <version>0.0.1-SNAPSHOT</version>
  8. <packaging>jar</packaging>
  9. <name>sys-manager-service</name>
  10. <description>Demo project for Spring Boot</description>
  11. <parent>
  12. <groupId>com.hcloud.microserver</groupId>
  13. <artifactId>common-parent</artifactId>
  14. <version>0.0.1-SNAPSHOT</version>
  15. <relativePath>../common-parent/pom.xml</relativePath>
  16. </parent>
  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>sys-manage-client</artifactId>
  26. <version>${sys.managerclient.version}</version>
  27. </dependency>
  28. <dependency>
  29. <groupId>org.mybatis</groupId>
  30. <artifactId>mybatis</artifactId>
  31. </dependency>
  32. <dependency>
  33. <groupId>org.springframework.boot</groupId>
  34. <artifactId>spring-boot-starter</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. <!-- Ribbon依赖 -->
  72. <dependency>
  73. <groupId>org.springframework.cloud</groupId>
  74. <artifactId>spring-cloud-starter-ribbon</artifactId>
  75. </dependency>
  76. </dependencies>
  77. <build>
  78. <plugins>
  79. <!-- 打JAR包 -->
  80. <plugin>
  81. <groupId>org.apache.maven.plugins</groupId>
  82. <artifactId>maven-jar-plugin</artifactId>
  83. <configuration>
  84. <!-- 不打包资源文件(配置文件和依赖包分开) -->
  85. <excludes>
  86. <exclude>*.**</exclude>
  87. <exclude>*/*.xml</exclude>
  88. </excludes>
  89. <archive>
  90. <manifest>
  91. <addClasspath>true</addClasspath>
  92. <!-- MANIFEST.MF 中 Class-Path 加入前缀 -->
  93. <classpathPrefix>lib/</classpathPrefix>
  94. <!-- jar包不包含唯一版本标识 -->
  95. <useUniqueVersions>false</useUniqueVersions>
  96. <!--指定入口类 -->
  97. <mainClass>com.hcloud.microserver.sys.service.SysManagerServiceApplication</mainClass>
  98. </manifest>
  99. <manifestEntries>
  100. <!--MANIFEST.MF 中 Class-Path 加入资源文件目录 -->
  101. <Class-Path>./resources/</Class-Path>
  102. </manifestEntries>
  103. </archive>
  104. <outputDirectory>${project.build.directory}</outputDirectory>
  105. </configuration>
  106. </plugin>
  107. <!-- 该插件的作用是用于复制依赖的jar包到指定的文件夹里 -->
  108. <plugin>
  109. <groupId>org.apache.maven.plugins</groupId>
  110. <artifactId>maven-dependency-plugin</artifactId>
  111. <executions>
  112. <execution>
  113. <id>copy-dependencies</id>
  114. <phase>package</phase>
  115. <goals>
  116. <goal>copy-dependencies</goal>
  117. </goals>
  118. <configuration>
  119. <outputDirectory>${project.build.directory}/lib/</outputDirectory>
  120. </configuration>
  121. </execution>
  122. </executions>
  123. </plugin>
  124. <!-- 该插件的作用是用于复制指定的文件 -->
  125. <plugin>
  126. <artifactId>maven-resources-plugin</artifactId>
  127. <executions>
  128. <execution> <!-- 复制配置文件 -->
  129. <id>copy-resources</id>
  130. <phase>package</phase>
  131. <goals>
  132. <goal>copy-resources</goal>
  133. </goals>
  134. <configuration>
  135. <resources>
  136. <resource>
  137. <directory>src/main/resources</directory>
  138. <includes>
  139. <!-- <include>*.properties</include> -->
  140. </includes>
  141. </resource>
  142. </resources>
  143. <outputDirectory>${project.build.directory}/resources</outputDirectory>
  144. </configuration>
  145. </execution>
  146. </executions>
  147. </plugin>
  148. <!-- SpringBoot 打包插件,把 maven-jar-plugin 打成的jar包重新打成可运行jar包 -->
  149. <plugin>
  150. <groupId>org.springframework.boot</groupId>
  151. <artifactId>spring-boot-maven-plugin</artifactId>
  152. <configuration>
  153. <!--重写包含依赖,包含不存在的依赖,jar里没有pom里的依赖 -->
  154. <includes>
  155. <include>
  156. <groupId>null</groupId>
  157. <artifactId>null</artifactId>
  158. </include>
  159. </includes>
  160. <layout>ZIP</layout>
  161. <!--使用外部配置文件,jar包里没有资源文件 -->
  162. <addResources>true</addResources>
  163. <outputDirectory>${project.build.directory}/resources</outputDirectory>
  164. </configuration>
  165. <executions>
  166. <execution>
  167. <goals>
  168. <goal>repackage</goal>
  169. </goals>
  170. <configuration>
  171. <!--配置jar包特殊标识 配置后,保留原文件,生成新文件 *-run.jar -->
  172. <!--配置jar包特殊标识 不配置,原文件命名为 *.jar.original,生成新文件 *.jar -->
  173. <classifier>run</classifier>
  174. </configuration>
  175. </execution>
  176. </executions>
  177. </plugin>
  178. <plugin>
  179. <groupId>org.apache.maven.plugins</groupId>
  180. <artifactId>maven-surefire-plugin</artifactId>
  181. <version>2.18.1</version>
  182. <configuration>
  183. <skipTests>true</skipTests>
  184. </configuration>
  185. </plugin>
  186. <plugin>
  187. <groupId>org.mybatis.generator</groupId>
  188. <artifactId>mybatis-generator-maven-plugin</artifactId>
  189. <version>1.3.5</version>
  190. <dependencies>
  191. <dependency>
  192. <groupId> mysql</groupId>
  193. <artifactId> mysql-connector-java</artifactId>
  194. <version>5.1.39</version>
  195. </dependency>
  196. <dependency>
  197. <groupId>org.mybatis.generator</groupId>
  198. <artifactId>mybatis-generator-core</artifactId>
  199. <version>1.3.5</version>
  200. </dependency>
  201. </dependencies>
  202. <executions>
  203. <execution>
  204. <id>Generate MyBatis Artifacts</id>
  205. <phase>deploy</phase>
  206. <goals>
  207. <goal>generate</goal>
  208. </goals>
  209. </execution>
  210. </executions>
  211. <configuration>
  212. <!--允许移动生成的文件 -->
  213. <verbose>true</verbose>
  214. <!-- 是否覆盖 -->
  215. <overwrite>true</overwrite>
  216. <!-- 自动生成的配置 -->
  217. <configurationFile>src/main/resources/generatorConfig.xml</configurationFile>
  218. </configuration>
  219. </plugin>
  220. </plugins>
  221. </build>
  222. </project>