pom.xml 7.1 KB

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