pom.xml 5.9 KB

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