pom.xml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  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. <java.jwt.version>3.7.0</java.jwt.version>
  21. </properties>
  22. <dependencies>
  23. <!--jwt 权限验证 -->
  24. <dependency>
  25. <groupId>com.auth0</groupId>
  26. <artifactId>java-jwt</artifactId>
  27. <version>${java.jwt.version}</version>
  28. </dependency>
  29. <dependency>
  30. <groupId>org.springframework.boot</groupId>
  31. <artifactId>spring-boot-starter</artifactId>
  32. <exclusions>
  33. <exclusion>
  34. <groupId>org.springframework.boot</groupId>
  35. <artifactId>spring-boot-starter-logging</artifactId>
  36. </exclusion>
  37. </exclusions>
  38. </dependency>
  39. <dependency>
  40. <groupId>org.springframework.boot</groupId>
  41. <artifactId>spring-boot-starter-log4j2</artifactId>
  42. </dependency>
  43. <dependency>
  44. <groupId>org.springframework.cloud</groupId>
  45. <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
  46. </dependency>
  47. <dependency>
  48. <groupId>org.springframework.cloud</groupId>
  49. <artifactId>spring-cloud-starter-gateway</artifactId>
  50. </dependency>
  51. <!--sleuth日志跟踪-->
  52. <dependency>
  53. <groupId>org.springframework.cloud</groupId>
  54. <artifactId>spring-cloud-starter-sleuth</artifactId>
  55. </dependency>
  56. <!-- spring cloud config 客户端包 -->
  57. <dependency>
  58. <groupId>org.springframework.cloud</groupId>
  59. <artifactId>spring-cloud-starter-config</artifactId>
  60. </dependency>
  61. <dependency>
  62. <groupId>org.springframework.boot</groupId>
  63. <artifactId>spring-boot-starter-actuator</artifactId>
  64. </dependency>
  65. <dependency>
  66. <groupId>org.springframework.boot</groupId>
  67. <artifactId>spring-boot-starter-test</artifactId>
  68. <scope>test</scope>
  69. </dependency>
  70. <!-- Eureka服务发现注册 -->
  71. <dependency>
  72. <groupId>org.springframework.cloud</groupId>
  73. <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
  74. </dependency>
  75. <!-- Feign 声明式服务 -->
  76. <dependency>
  77. <groupId>org.springframework.cloud</groupId>
  78. <artifactId>spring-cloud-starter-openfeign</artifactId>
  79. </dependency>
  80. </dependencies>
  81. <dependencyManagement>
  82. <dependencies>
  83. <dependency>
  84. <groupId>org.springframework.cloud</groupId>
  85. <artifactId>spring-cloud-dependencies</artifactId>
  86. <version>${spring-cloud.version}</version>
  87. <type>pom</type>
  88. <scope>import</scope>
  89. </dependency>
  90. </dependencies>
  91. </dependencyManagement>
  92. <build>
  93. <!-- jar包名 -->
  94. <finalName>GatewayServer</finalName>
  95. <!--默认源代码目录 -->
  96. <sourceDirectory>src/main/java </sourceDirectory>
  97. <!--默认测试源代码目录 -->
  98. <testSourceDirectory>src/test/java</testSourceDirectory>
  99. <!--默认资源目录 -->
  100. <resources>
  101. <resource>
  102. <directory>src/main/resources</directory>
  103. </resource>
  104. </resources>
  105. <plugins>
  106. <plugin>
  107. <groupId>org.apache.maven.plugins</groupId>
  108. <artifactId>maven-compiler-plugin</artifactId>
  109. <configuration>
  110. <source>1.8</source>
  111. <target>1.8</target>
  112. <skip>true</skip>
  113. </configuration>
  114. </plugin>
  115. <plugin>
  116. <groupId>org.springframework.boot</groupId>
  117. <artifactId>spring-boot-maven-plugin</artifactId>
  118. </plugin>
  119. <plugin>
  120. <groupId>org.apache.maven.plugins</groupId>
  121. <artifactId>maven-surefire-plugin</artifactId>
  122. <configuration>
  123. <skip>true</skip>
  124. </configuration>
  125. </plugin>
  126. <plugin>
  127. <groupId>org.apache.maven.plugins</groupId>
  128. <artifactId>maven-jar-plugin</artifactId>
  129. <version>3.1.1</version>
  130. <configuration>
  131. <!-- 指定打包的jar包输出路径 -->
  132. <outputDirectory>${project.build.directory}/GatewayServer</outputDirectory>
  133. <!--不打入jar包的文件类型或者路径 -->
  134. <excludes>
  135. <!-- <exclude>**/*.properties</exclude> -->
  136. <!-- <exclude>**/*.xml</exclude> -->
  137. <!-- <exclude>**/*.yml</exclude> -->
  138. <!-- <exclude>static/**</exclude> -->
  139. <!-- <exclude>templates/**</exclude> -->
  140. </excludes>
  141. <archive>
  142. <!-- 指定配置文件目录,这样jar运行时会去找到同目录下的resources文件夹下查找 -->
  143. <manifestEntries>
  144. <Class-Path>resources/</Class-Path>
  145. </manifestEntries>
  146. <manifest>
  147. <addClasspath>true</addClasspath>
  148. <classpathPrefix>lib/</classpathPrefix>
  149. <mainClass>com.leanwo.gateway.GatewayApp</mainClass>
  150. </manifest>
  151. </archive>
  152. <!--注意这玩意从编译结果目录开始算目录结构-->
  153. <excludes>
  154. <exclude>**/*.yml</exclude>
  155. <exclude>**/*.xml</exclude>
  156. <exclude>**/*.bat</exclude>
  157. <exclude>**/*.properties</exclude>
  158. <exclude>**/*.sql</exclude>
  159. <exclude>**/*.txt</exclude>
  160. <exclude>**/*.jks</exclude>
  161. </excludes>
  162. </configuration>
  163. </plugin>
  164. <!-- 分离lib -->
  165. <plugin>
  166. <groupId>org.apache.maven.plugins</groupId>
  167. <artifactId>maven-dependency-plugin</artifactId>
  168. <executions>
  169. <execution>
  170. <id>copy-dependencies</id>
  171. <phase>package</phase>
  172. <goals>
  173. <goal>copy-dependencies</goal>
  174. </goals>
  175. <configuration>
  176. <!-- 依赖包输出目录 -->
  177. <outputDirectory>${project.build.directory}/GatewayServer/lib</outputDirectory>
  178. <excludeTransitive>false</excludeTransitive>
  179. <stripVersion>false</stripVersion>
  180. <!-- 依赖包的作用域 -->
  181. <includeScope>runtime</includeScope>
  182. </configuration>
  183. </execution>
  184. </executions>
  185. </plugin>
  186. <!-- 复制资源文件 -->
  187. <plugin>
  188. <groupId>org.apache.maven.plugins</groupId>
  189. <artifactId>maven-resources-plugin</artifactId>
  190. <executions>
  191. <execution>
  192. <id>copy-dependencies</id>
  193. <phase>package</phase>
  194. <goals>
  195. <goal>copy-resources</goal>
  196. </goals>
  197. <configuration>
  198. <!-- 资源文件输出目录 -->
  199. <outputDirectory>${project.build.directory}/GatewayServer/resources</outputDirectory>
  200. <resources>
  201. <resource>
  202. <directory>src/main/resources</directory>
  203. <excludes>
  204. <exclude>*.bat</exclude>
  205. </excludes>
  206. </resource>
  207. </resources>
  208. </configuration>
  209. </execution>
  210. <execution>
  211. <id>copy-dependencies-bat</id>
  212. <phase>package</phase>
  213. <goals>
  214. <goal>copy-resources</goal>
  215. </goals>
  216. <configuration>
  217. <!-- 资源文件输出目录 -->
  218. <outputDirectory>${project.build.directory}/GatewayServer</outputDirectory>
  219. <resources>
  220. <resource>
  221. <directory>src/main/resources</directory>
  222. <includes>
  223. <include>*.bat</include>
  224. </includes>
  225. </resource>
  226. </resources>
  227. </configuration>
  228. </execution>
  229. </executions>
  230. </plugin>
  231. </plugins>
  232. </build>
  233. </project>