pom.xml 9.6 KB

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