pom.xml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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. <relativePath /> <!-- lookup parent from repository -->
  17. </parent>
  18. <properties>
  19. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  20. <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  21. <java.version>1.8</java.version>
  22. <spring-cloud.version>Hoxton.RELEASE</spring-cloud.version>
  23. </properties>
  24. <dependencies>
  25. <dependency>
  26. <groupId>org.springframework.boot</groupId>
  27. <artifactId>spring-boot-starter</artifactId>
  28. <exclusions>
  29. <exclusion>
  30. <groupId>org.springframework.boot</groupId>
  31. <artifactId>spring-boot-starter-logging</artifactId>
  32. </exclusion>
  33. </exclusions>
  34. </dependency>
  35. <dependency>
  36. <groupId>org.springframework.boot</groupId>
  37. <artifactId>spring-boot-starter-log4j2</artifactId>
  38. </dependency>
  39. <dependency>
  40. <groupId>org.springframework.cloud</groupId>
  41. <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
  42. </dependency>
  43. <dependency>
  44. <groupId>org.springframework.boot</groupId>
  45. <artifactId>spring-boot-starter-test</artifactId>
  46. <scope>test</scope>
  47. </dependency>
  48. <dependency>
  49. <groupId>junit</groupId>
  50. <artifactId>junit</artifactId>
  51. <scope>test</scope>
  52. </dependency>
  53. </dependencies>
  54. <dependencyManagement>
  55. <dependencies>
  56. <dependency>
  57. <groupId>org.springframework.cloud</groupId>
  58. <artifactId>spring-cloud-dependencies</artifactId>
  59. <version>${spring-cloud.version}</version>
  60. <type>pom</type>
  61. <scope>import</scope>
  62. </dependency>
  63. </dependencies>
  64. </dependencyManagement>
  65. <build>
  66. <!-- jar包名 -->
  67. <finalName>ServerManagement</finalName>
  68. <!--默认源代码目录 -->
  69. <sourceDirectory>src/main/java </sourceDirectory>
  70. <!--默认测试源代码目录 -->
  71. <testSourceDirectory>src/test/java</testSourceDirectory>
  72. <!--默认资源目录 -->
  73. <resources>
  74. <resource>
  75. <directory>src/main/resources</directory>
  76. </resource>
  77. </resources>
  78. <plugins>
  79. <plugin>
  80. <groupId>org.apache.maven.plugins</groupId>
  81. <artifactId>maven-compiler-plugin</artifactId>
  82. <configuration>
  83. <source>1.8</source>
  84. <target>1.8</target>
  85. </configuration>
  86. </plugin>
  87. <plugin>
  88. <groupId>org.springframework.boot</groupId>
  89. <artifactId>spring-boot-maven-plugin</artifactId>
  90. </plugin>
  91. <!-- 忽略junit单元测试 -->
  92. <plugin>
  93. <groupId>org.apache.maven.plugins</groupId>
  94. <artifactId>maven-surefire-plugin</artifactId>
  95. <version>2.20.1</version>
  96. <configuration>
  97. <skip>true</skip>
  98. </configuration>
  99. </plugin>
  100. <plugin>
  101. <groupId>org.apache.maven.plugins</groupId>
  102. <artifactId>maven-jar-plugin</artifactId>
  103. <configuration>
  104. <!-- 指定打包的jar包输出路径 -->
  105. <outputDirectory>${project.build.directory}/${project.version}</outputDirectory>
  106. <!--不打入jar包的文件类型或者路径 -->
  107. <excludes>
  108. <!-- <exclude>**/*.properties</exclude> -->
  109. <!-- <exclude>**/*.xml</exclude> -->
  110. <!-- <exclude>**/*.yml</exclude> -->
  111. <!-- <exclude>static/**</exclude> -->
  112. <!-- <exclude>templates/**</exclude> -->
  113. </excludes>
  114. <archive>
  115. <!-- 指定配置文件目录,这样jar运行时会去找到同目录下的resources文件夹下查找 -->
  116. <manifestEntries>
  117. <Class-Path>resources/</Class-Path>
  118. </manifestEntries>
  119. <manifest>
  120. <addClasspath>true</addClasspath>
  121. <classpathPrefix>lib/</classpathPrefix>
  122. <mainClass>com.leanwo.management.ServerManagementApp</mainClass>
  123. </manifest>
  124. </archive>
  125. </configuration>
  126. </plugin>
  127. <!-- 复制资源文件 -->
  128. <plugin>
  129. <artifactId>maven-resources-plugin</artifactId>
  130. <executions>
  131. <execution>
  132. <id>copy-dependencies</id>
  133. <phase>package</phase>
  134. <goals>
  135. <goal>copy-resources</goal>
  136. </goals>
  137. <configuration>
  138. <!-- 资源文件输出目录 -->
  139. <outputDirectory>${project.build.directory}/${project.version}/resources</outputDirectory>
  140. <resources>
  141. <resource>
  142. <directory>src/main/resources</directory>
  143. <excludes>
  144. <exclude>*.bat</exclude>
  145. </excludes>
  146. </resource>
  147. </resources>
  148. </configuration>
  149. </execution>
  150. <execution>
  151. <id>copy-dependencies-bat</id>
  152. <phase>package</phase>
  153. <goals>
  154. <goal>copy-resources</goal>
  155. </goals>
  156. <configuration>
  157. <!-- 资源文件输出目录 -->
  158. <outputDirectory>${project.build.directory}/${project.version}</outputDirectory>
  159. <resources>
  160. <resource>
  161. <directory>src/main/resources</directory>
  162. <includes>
  163. <include>*.bat</include>
  164. </includes>
  165. </resource>
  166. </resources>
  167. </configuration>
  168. </execution>
  169. </executions>
  170. </plugin>
  171. <!-- 分离lib -->
  172. <plugin>
  173. <groupId>org.apache.maven.plugins</groupId>
  174. <artifactId>maven-dependency-plugin</artifactId>
  175. <executions>
  176. <execution>
  177. <id>copy-dependencies</id>
  178. <phase>package</phase>
  179. <goals>
  180. <goal>copy-dependencies</goal>
  181. </goals>
  182. <configuration>
  183. <!-- 依赖包输出目录 -->
  184. <outputDirectory>${project.build.directory}/${project.version}/lib</outputDirectory>
  185. <excludeTransitive>false</excludeTransitive>
  186. <stripVersion>false</stripVersion>
  187. <!-- 依赖包的作用域 -->
  188. <includeScope>runtime</includeScope>
  189. </configuration>
  190. </execution>
  191. </executions>
  192. </plugin>
  193. </plugins>
  194. </build>
  195. </project>