pom.xml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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>carbon-service</artifactId>
  8. <version>0.0.1-SNAPSHOT</version>
  9. <relativePath>../../carbon-service/pom.xml</relativePath>
  10. </parent>
  11. <groupId>com.hcloud.microserver</groupId>
  12. <artifactId>carbon-manager-service</artifactId>
  13. <version>0.0.1-SNAPSHOT</version>
  14. <name>carbon-manager-service</name>
  15. <description>Demo project for Spring Boot</description>
  16. <properties>
  17. <java.version>1.8</java.version>
  18. </properties>
  19. <dependencies>
  20. <dependency>
  21. <groupId>com.hcloud.microserver</groupId>
  22. <artifactId>common-core</artifactId>
  23. <version>${common.core.version}</version>
  24. </dependency>
  25. <dependency>
  26. <groupId>com.hcloud.microserver</groupId>
  27. <artifactId>carbon-manager-client</artifactId>
  28. <version>0.0.1-SNAPSHOT</version>
  29. </dependency>
  30. <dependency>
  31. <groupId>org.mybatis</groupId>
  32. <artifactId>mybatis</artifactId>
  33. </dependency>
  34. <dependency>
  35. <groupId>org.springframework.boot</groupId>
  36. <artifactId>spring-boot-starter</artifactId>
  37. </dependency>
  38. <dependency>
  39. <groupId>org.mybatis.spring.boot</groupId>
  40. <artifactId>mybatis-spring-boot-starter</artifactId>
  41. </dependency>
  42. <dependency>
  43. <groupId>org.springframework.cloud</groupId>
  44. <artifactId>spring-cloud-starter-eureka</artifactId>
  45. </dependency>
  46. <!--druid -->
  47. <dependency>
  48. <groupId>com.alibaba</groupId>
  49. <artifactId>druid</artifactId>
  50. </dependency>
  51. <!-- 分页支持pageHelper -->
  52. <dependency>
  53. <groupId>com.github.pagehelper</groupId>
  54. <artifactId>pagehelper-spring-boot-starter</artifactId>
  55. </dependency>
  56. <dependency>
  57. <groupId>org.mybatis.spring.boot</groupId>
  58. <artifactId>mybatis-spring-boot-starter</artifactId>
  59. </dependency>
  60. <dependency>
  61. <groupId>mysql</groupId>
  62. <artifactId>mysql-connector-java</artifactId>
  63. </dependency>
  64. <dependency>
  65. <groupId>org.springframework.boot</groupId>
  66. <artifactId>spring-boot-starter-cache</artifactId>
  67. <version>1.5.18.RELEASE</version>
  68. </dependency>
  69. <dependency>
  70. <groupId>org.springframework.boot</groupId>
  71. <artifactId>spring-boot-starter-data-redis</artifactId>
  72. </dependency>
  73. <!-- Ribbon依赖 -->
  74. <dependency>
  75. <groupId>org.springframework.cloud</groupId>
  76. <artifactId>spring-cloud-starter-ribbon</artifactId>
  77. </dependency>
  78. <dependency>
  79. <groupId>com.alibaba</groupId>
  80. <artifactId>fastjson</artifactId>
  81. </dependency>
  82. </dependencies>
  83. <build>
  84. <plugins>
  85. <!-- 打JAR包 -->
  86. <plugin>
  87. <groupId>org.apache.maven.plugins</groupId>
  88. <artifactId>maven-jar-plugin</artifactId>
  89. <configuration>
  90. <!-- 不打包资源文件(配置文件和依赖包分开) -->
  91. <excludes>
  92. <exclude>*.**</exclude>
  93. <exclude>*/*.xml</exclude>
  94. </excludes>
  95. <archive>
  96. <manifest>
  97. <addClasspath>true</addClasspath>
  98. <!-- MANIFEST.MF 中 Class-Path 加入前缀 -->
  99. <classpathPrefix>lib/</classpathPrefix>
  100. <!-- jar包不包含唯一版本标识 -->
  101. <useUniqueVersions>false</useUniqueVersions>
  102. <!--指定入口类 -->
  103. <mainClass>com.hcloud.microserver.bank.CarbonManagerServiceApplication</mainClass>
  104. </manifest>
  105. <manifestEntries>
  106. <!--MANIFEST.MF 中 Class-Path 加入资源文件目录 -->
  107. <Class-Path>./resources/</Class-Path>
  108. </manifestEntries>
  109. </archive>
  110. <outputDirectory>${project.build.directory}</outputDirectory>
  111. </configuration>
  112. </plugin>
  113. <!-- 该插件的作用是用于复制依赖的jar包到指定的文件夹里 -->
  114. <plugin>
  115. <groupId>org.apache.maven.plugins</groupId>
  116. <artifactId>maven-dependency-plugin</artifactId>
  117. <executions>
  118. <execution>
  119. <id>copy-dependencies</id>
  120. <phase>package</phase>
  121. <goals>
  122. <goal>copy-dependencies</goal>
  123. </goals>
  124. <configuration>
  125. <outputDirectory>${project.build.directory}/lib/</outputDirectory>
  126. </configuration>
  127. </execution>
  128. </executions>
  129. </plugin>
  130. <!-- 该插件的作用是用于复制指定的文件 -->
  131. <plugin>
  132. <artifactId>maven-resources-plugin</artifactId>
  133. <executions>
  134. <execution> <!-- 复制配置文件 -->
  135. <id>copy-resources</id>
  136. <phase>package</phase>
  137. <goals>
  138. <goal>copy-resources</goal>
  139. </goals>
  140. <configuration>
  141. <resources>
  142. <resource>
  143. <directory>src/main/resources</directory>
  144. <includes>
  145. <!-- <include>*.properties</include> -->
  146. </includes>
  147. </resource>
  148. </resources>
  149. <outputDirectory>${project.build.directory}/resources</outputDirectory>
  150. </configuration>
  151. </execution>
  152. </executions>
  153. </plugin>
  154. <!-- SpringBoot 打包插件,把 maven-jar-plugin 打成的jar包重新打成可运行jar包 -->
  155. <plugin>
  156. <groupId>org.springframework.boot</groupId>
  157. <artifactId>spring-boot-maven-plugin</artifactId>
  158. <configuration>
  159. <!--重写包含依赖,包含不存在的依赖,jar里没有pom里的依赖 -->
  160. <includes>
  161. <include>
  162. <groupId>null</groupId>
  163. <artifactId>null</artifactId>
  164. </include>
  165. </includes>
  166. <layout>ZIP</layout>
  167. <!--使用外部配置文件,jar包里没有资源文件 -->
  168. <addResources>true</addResources>
  169. <outputDirectory>${project.build.directory}/resources</outputDirectory>
  170. </configuration>
  171. <executions>
  172. <execution>
  173. <goals>
  174. <goal>repackage</goal>
  175. </goals>
  176. <configuration>
  177. <!--配置jar包特殊标识 配置后,保留原文件,生成新文件 *-run.jar -->
  178. <!--配置jar包特殊标识 不配置,原文件命名为 *.jar.original,生成新文件 *.jar -->
  179. <classifier>run</classifier>
  180. </configuration>
  181. </execution>
  182. </executions>
  183. </plugin>
  184. <plugin>
  185. <groupId>org.apache.maven.plugins</groupId>
  186. <artifactId>maven-surefire-plugin</artifactId>
  187. <version>2.18.1</version>
  188. <configuration>
  189. <skipTests>true</skipTests>
  190. </configuration>
  191. </plugin>
  192. <plugin>
  193. <groupId>org.mybatis.generator</groupId>
  194. <artifactId>mybatis-generator-maven-plugin</artifactId>
  195. <version>1.3.5</version>
  196. <dependencies>
  197. <dependency>
  198. <groupId> mysql</groupId>
  199. <artifactId> mysql-connector-java</artifactId>
  200. <version>5.1.39</version>
  201. </dependency>
  202. <dependency>
  203. <groupId>org.mybatis.generator</groupId>
  204. <artifactId>mybatis-generator-core</artifactId>
  205. <version>1.3.5</version>
  206. </dependency>
  207. </dependencies>
  208. <executions>
  209. <execution>
  210. <id>Generate MyBatis Artifacts</id>
  211. <phase>deploy</phase>
  212. <goals>
  213. <goal>generate</goal>
  214. </goals>
  215. </execution>
  216. </executions>
  217. <configuration>
  218. <!--允许移动生成的文件 -->
  219. <verbose>true</verbose>
  220. <!-- 是否覆盖 -->
  221. <overwrite>true</overwrite>
  222. <!-- 自动生成的配置 -->
  223. <configurationFile>src/main/resources/generatorConfig.xml</configurationFile>
  224. </configuration>
  225. </plugin>
  226. </plugins>
  227. </build>
  228. </project>