pom.xml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <project xmlns="http://maven.apache.org/POM/4.0.0"
  2. 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. <groupId>org.leanwo.server.management</groupId>
  6. <artifactId>ServerManagement</artifactId>
  7. <version>0.0.1</version>
  8. <packaging>jar</packaging>
  9. <name>ServerManagement</name>
  10. <url>http://maven.apache.org</url>
  11. <!--指定父级依赖 -->
  12. <parent>
  13. <groupId>org.springframework.boot</groupId>
  14. <artifactId>spring-boot-starter-parent</artifactId>
  15. <version>2.2.4.RELEASE</version>
  16. </parent>
  17. <properties>
  18. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  19. <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  20. <java.version>1.8</java.version>
  21. <spring-cloud.version>Hoxton.RELEASE</spring-cloud.version>
  22. </properties>
  23. <dependencies>
  24. <dependency>
  25. <groupId>org.yaml</groupId>
  26. <artifactId>snakeyaml</artifactId>
  27. </dependency>
  28. <dependency>
  29. <groupId>org.springframework.boot</groupId>
  30. <artifactId>spring-boot-starter</artifactId>
  31. <exclusions>
  32. <exclusion>
  33. <groupId>org.springframework.boot</groupId>
  34. <artifactId>spring-boot-starter-logging</artifactId>
  35. </exclusion>
  36. </exclusions>
  37. </dependency>
  38. <dependency>
  39. <groupId>org.springframework.boot</groupId>
  40. <artifactId>spring-boot-starter-log4j2</artifactId>
  41. </dependency>
  42. <dependency>
  43. <groupId>org.springframework.cloud</groupId>
  44. <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
  45. </dependency>
  46. <!-- https://mvnrepository.com/artifact/org.dom4j/dom4j -->
  47. <dependency>
  48. <groupId>org.dom4j</groupId>
  49. <artifactId>dom4j</artifactId>
  50. <version>2.1.3</version>
  51. </dependency>
  52. <!-- 发布成服务 -->
  53. <dependency>
  54. <groupId>commons-daemon</groupId>
  55. <artifactId>commons-daemon</artifactId>
  56. <version>1.2.3</version>
  57. </dependency>
  58. <dependency>
  59. <groupId>org.springframework.boot</groupId>
  60. <artifactId>spring-boot-starter-test</artifactId>
  61. <scope>test</scope>
  62. </dependency>
  63. <dependency>
  64. <groupId>junit</groupId>
  65. <artifactId>junit</artifactId>
  66. <scope>test</scope>
  67. </dependency>
  68. </dependencies>
  69. <dependencyManagement>
  70. <dependencies>
  71. <dependency>
  72. <groupId>org.springframework.cloud</groupId>
  73. <artifactId>spring-cloud-dependencies</artifactId>
  74. <version>${spring-cloud.version}</version>
  75. <type>pom</type>
  76. <scope>import</scope>
  77. </dependency>
  78. </dependencies>
  79. </dependencyManagement>
  80. <build>
  81. <!-- jar包名 -->
  82. <finalName>ServerManagement</finalName>
  83. <!--默认源代码目录 -->
  84. <sourceDirectory>src/main/java </sourceDirectory>
  85. <!--默认测试源代码目录 -->
  86. <testSourceDirectory>src/test/java</testSourceDirectory>
  87. <!--默认资源目录 -->
  88. <resources>
  89. <resource>
  90. <directory>src/main/resources</directory>
  91. </resource>
  92. </resources>
  93. <plugins>
  94. <plugin>
  95. <groupId>org.apache.maven.plugins</groupId>
  96. <artifactId>maven-compiler-plugin</artifactId>
  97. <configuration>
  98. <source>1.8</source>
  99. <target>1.8</target>
  100. </configuration>
  101. </plugin>
  102. <plugin>
  103. <groupId>org.springframework.boot</groupId>
  104. <artifactId>spring-boot-maven-plugin</artifactId>
  105. </plugin>
  106. <!-- 忽略junit单元测试 -->
  107. <plugin>
  108. <groupId>org.apache.maven.plugins</groupId>
  109. <artifactId>maven-surefire-plugin</artifactId>
  110. <configuration>
  111. <skip>true</skip>
  112. </configuration>
  113. </plugin>
  114. <plugin>
  115. <groupId>org.apache.maven.plugins</groupId>
  116. <artifactId>maven-jar-plugin</artifactId>
  117. <version>3.1.1</version>
  118. <configuration>
  119. <!-- 指定打包的jar包输出路径 -->
  120. <outputDirectory>${project.build.directory}/ServerManagement</outputDirectory>
  121. <!--注意这玩意从编译结果目录开始算目录结构-->
  122. <excludes>
  123. <exclude>**/*.yml</exclude>
  124. <exclude>**/*.xml</exclude>
  125. <exclude>**/*.bat</exclude>
  126. <exclude>**/*.properties</exclude>
  127. <exclude>**/*.sql</exclude>
  128. <exclude>**/*.txt</exclude>
  129. <exclude>**/*.jks</exclude>
  130. </excludes>
  131. <archive>
  132. <!-- 指定配置文件目录,这样jar运行时会去找到同目录下的resources文件夹下查找 -->
  133. <manifestEntries>
  134. <Class-Path>resources/</Class-Path>
  135. </manifestEntries>
  136. <manifest>
  137. <addClasspath>true</addClasspath>
  138. <classpathPrefix>lib/</classpathPrefix>
  139. <mainClass>com.leanwo.management.ServerManagementApp</mainClass>
  140. </manifest>
  141. </archive>
  142. </configuration>
  143. </plugin>
  144. <!-- 复制资源文件 -->
  145. <plugin>
  146. <artifactId>maven-resources-plugin</artifactId>
  147. <executions>
  148. <execution>
  149. <id>copy-dependencies</id>
  150. <phase>package</phase>
  151. <goals>
  152. <goal>copy-resources</goal>
  153. </goals>
  154. <configuration>
  155. <!-- 资源文件输出目录 -->
  156. <outputDirectory>${project.build.directory}/ServerManagement/resources</outputDirectory>
  157. <resources>
  158. <resource>
  159. <directory>src/main/resources</directory>
  160. <excludes>
  161. <exclude>*.bat</exclude>
  162. <exclude>**/bin/**</exclude>
  163. </excludes>
  164. </resource>
  165. </resources>
  166. </configuration>
  167. </execution>
  168. <execution>
  169. <id>copy-dependencies-bat</id>
  170. <phase>package</phase>
  171. <goals>
  172. <goal>copy-resources</goal>
  173. </goals>
  174. <configuration>
  175. <!-- 资源文件输出目录 -->
  176. <outputDirectory>${project.build.directory}/ServerManagement</outputDirectory>
  177. <resources>
  178. <resource>
  179. <directory>src/main/resources</directory>
  180. <includes>
  181. <include>*.bat</include>
  182. <include>**/bin/**</include>
  183. </includes>
  184. </resource>
  185. </resources>
  186. </configuration>
  187. </execution>
  188. </executions>
  189. </plugin>
  190. <!-- 分离lib -->
  191. <plugin>
  192. <groupId>org.apache.maven.plugins</groupId>
  193. <artifactId>maven-dependency-plugin</artifactId>
  194. <executions>
  195. <execution>
  196. <id>copy-dependencies</id>
  197. <phase>package</phase>
  198. <goals>
  199. <goal>copy-dependencies</goal>
  200. </goals>
  201. <configuration>
  202. <!-- 依赖包输出目录 -->
  203. <outputDirectory>${project.build.directory}/ServerManagement/lib</outputDirectory>
  204. <excludeTransitive>false</excludeTransitive>
  205. <stripVersion>false</stripVersion>
  206. <!-- 依赖包的作用域 -->
  207. <includeScope>runtime</includeScope>
  208. </configuration>
  209. </execution>
  210. </executions>
  211. </plugin>
  212. </plugins>
  213. </build>
  214. </project>