pom.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5. <modelVersion>4.0.0</modelVersion>
  6. <parent>
  7. <groupId>org.springframework.boot</groupId>
  8. <artifactId>spring-boot-starter-parent</artifactId>
  9. <version>3.3.5</version>
  10. <relativePath/>
  11. </parent>
  12. <groupId>com.punchsettle</groupId>
  13. <artifactId>server</artifactId>
  14. <version>1.0-SNAPSHOT</version>
  15. <properties>
  16. <maven.compiler.source>21</maven.compiler.source>
  17. <maven.compiler.target>21</maven.compiler.target>
  18. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  19. <java.version>21</java.version>
  20. <spring-cloud.version>2023.0.3</spring-cloud.version>
  21. <mybatis-mapper.version>2.2.4</mybatis-mapper.version>
  22. <jwt.version>4.4.0</jwt.version>
  23. <mybatis-springboot-starter.version>3.0.3</mybatis-springboot-starter.version>
  24. </properties>
  25. <dependencyManagement>
  26. <dependencies>
  27. <dependency>
  28. <groupId>org.springframework.cloud</groupId>
  29. <artifactId>spring-cloud-dependencies</artifactId>
  30. <version>${spring-cloud.version}</version>
  31. <type>pom</type>
  32. <scope>import</scope>
  33. </dependency>
  34. </dependencies>
  35. </dependencyManagement>
  36. <dependencies>
  37. <dependency>
  38. <groupId>org.springframework.cloud</groupId>
  39. <artifactId>spring-cloud-starter-openfeign</artifactId>
  40. </dependency>
  41. <dependency>
  42. <groupId>org.springframework.boot</groupId>
  43. <artifactId>spring-boot-starter-validation</artifactId>
  44. </dependency>
  45. <dependency>
  46. <groupId>org.springframework.boot</groupId>
  47. <artifactId>spring-boot-starter-test</artifactId>
  48. <scope>test</scope>
  49. </dependency>
  50. <dependency>
  51. <groupId>org.springframework.boot</groupId>
  52. <artifactId>spring-boot-starter-web</artifactId>
  53. </dependency>
  54. <dependency>
  55. <groupId>org.springframework.boot</groupId>
  56. <artifactId>spring-boot-starter-aop</artifactId>
  57. </dependency>
  58. <dependency>
  59. <groupId>org.springframework.boot</groupId>
  60. <artifactId>spring-boot-starter-cache</artifactId>
  61. </dependency>
  62. <dependency>
  63. <groupId>com.github.ben-manes.caffeine</groupId>
  64. <artifactId>caffeine</artifactId>
  65. </dependency>
  66. <dependency>
  67. <groupId>org.springframework</groupId>
  68. <artifactId>spring-tx</artifactId>
  69. </dependency>
  70. <dependency>
  71. <groupId>com.mysql</groupId>
  72. <artifactId>mysql-connector-j</artifactId>
  73. <scope>runtime</scope>
  74. </dependency>
  75. <dependency>
  76. <groupId>org.projectlombok</groupId>
  77. <artifactId>lombok</artifactId>
  78. <optional>true</optional>
  79. </dependency>
  80. <dependency>
  81. <groupId>io.mybatis</groupId>
  82. <artifactId>mybatis-mapper</artifactId>
  83. <version>${mybatis-mapper.version}</version>
  84. </dependency>
  85. <!-- 使用 Service 层封装时 -->
  86. <dependency>
  87. <groupId>io.mybatis</groupId>
  88. <artifactId>mybatis-service</artifactId>
  89. <version>${mybatis-mapper.version}</version>
  90. </dependency>
  91. <dependency>
  92. <groupId>org.mybatis.spring.boot</groupId>
  93. <artifactId>mybatis-spring-boot-starter</artifactId>
  94. <version>${mybatis-springboot-starter.version}</version>
  95. </dependency>
  96. <dependency>
  97. <groupId>com.auth0</groupId>
  98. <artifactId>java-jwt</artifactId>
  99. <version>${jwt.version}</version>
  100. </dependency>
  101. </dependencies>
  102. <!-- 配置阿里云仓库 -->
  103. <repositories>
  104. <repository>
  105. <id>aliyun-repos</id>
  106. <url>https://maven.aliyun.com/repository/public</url>
  107. <releases>
  108. <enabled>true</enabled>
  109. </releases>
  110. <snapshots>
  111. <enabled>false</enabled>
  112. </snapshots>
  113. </repository>
  114. </repositories>
  115. <pluginRepositories>
  116. <pluginRepository>
  117. <id>aliyun-repos</id>
  118. <url>https://maven.aliyun.com/repository/public</url>
  119. <releases>
  120. <enabled>true</enabled>
  121. </releases>
  122. <snapshots>
  123. <enabled>false</enabled>
  124. </snapshots>
  125. </pluginRepository>
  126. </pluginRepositories>
  127. <build>
  128. <plugins>
  129. <plugin>
  130. <groupId>org.springframework.boot</groupId>
  131. <artifactId>spring-boot-maven-plugin</artifactId>
  132. <configuration>
  133. <!--引入第三方jar包时,不添加则引入的第三方jar不会被打入jar包中-->
  134. <includeSystemScope>true</includeSystemScope>
  135. <!--排除第三方jar文件-->
  136. <includes>
  137. <include>
  138. <groupId>nothing</groupId>
  139. <artifactId>nothing</artifactId>
  140. </include>
  141. </includes>
  142. <excludes>
  143. <exclude>
  144. <groupId>org.projectlombok</groupId>
  145. <artifactId>lombok</artifactId>
  146. </exclude>
  147. </excludes>
  148. </configuration>
  149. <executions>
  150. <execution>
  151. <goals>
  152. <goal>repackage</goal>
  153. </goals>
  154. </execution>
  155. </executions>
  156. </plugin>
  157. <!-- 2、完成对Java代码的编译,可以指定项目源码的jdk版本,编译后的jdk版本,以及编码 -->
  158. <plugin>
  159. <groupId>org.apache.maven.plugins</groupId>
  160. <artifactId>maven-compiler-plugin</artifactId>
  161. <configuration>
  162. <!-- 源代码使用的JDK版本 -->
  163. <source>${java.version}</source>
  164. <!-- 需要生成的目标class文件的编译版本 -->
  165. <target>${java.version}</target>
  166. <!-- 字符集编码 -->
  167. <encoding>UTF-8</encoding>
  168. <!-- 用来传递编译器自身不包含但是却支持的参数选项 -->
  169. <!-- <compilerArguments>-->
  170. <!-- <verbose/>-->
  171. <!-- &lt;!&ndash; windwos环境(二选一) &ndash;&gt;-->
  172. <!-- <bootclasspath>${java.home}/lib/rt.jar:${java.home}/lib/jce.jar</bootclasspath>-->
  173. <!-- &lt;!&ndash; Linux环境(二选一) &ndash;&gt;-->
  174. <!-- <bootclasspath>${java.home}/lib/rt.jar:${java.home}/lib/jce.jar</bootclasspath>-->
  175. <!-- </compilerArguments>-->
  176. <annotationProcessorPaths>
  177. <path>
  178. <groupId>org.projectlombok</groupId>
  179. <artifactId>lombok</artifactId>
  180. <version>${lombok.version}</version>
  181. </path>
  182. </annotationProcessorPaths>
  183. </configuration>
  184. </plugin>
  185. <!-- 3、将所有依赖的jar文件复制到target/lib目录 -->
  186. <plugin>
  187. <groupId>org.apache.maven.plugins</groupId>
  188. <artifactId>maven-dependency-plugin</artifactId>
  189. <executions>
  190. <execution>
  191. <id>copy-dependencies</id>
  192. <phase>prepare-package</phase>
  193. <goals>
  194. <goal>copy-dependencies</goal>
  195. </goals>
  196. <configuration>
  197. <!--复制到哪个路径,${project.build.directory} 缺醒为 target,其他内置参数见下面解释-->
  198. <outputDirectory>${project.build.directory}/lib</outputDirectory>
  199. <overWriteReleases>false</overWriteReleases>
  200. <overWriteSnapshots>false</overWriteSnapshots>
  201. <overWriteIfNewer>true</overWriteIfNewer>
  202. </configuration>
  203. </execution>
  204. </executions>
  205. </plugin>
  206. <!-- 4、指定启动类,指定配置文件,将依赖打成外部jar包 -->
  207. <plugin>
  208. <groupId>org.apache.maven.plugins</groupId>
  209. <artifactId>maven-jar-plugin</artifactId>
  210. <configuration>
  211. <archive>
  212. <manifest>
  213. <!-- 是否要把第三方jar加入到类构建路径 -->
  214. <addClasspath>true</addClasspath>
  215. <!-- 外部依赖jar包的最终位置 -->
  216. <classpathPrefix>lib/</classpathPrefix>
  217. <!-- 项目启动类 -->
  218. <mainClass>com.zhixinghe1.ots.OnlineToolServiceApplication</mainClass>
  219. </manifest>
  220. </archive>
  221. <!--资源文件不打进jar包中,做到配置跟项目分离的效果-->
  222. <!-- <excludes>-->
  223. <!-- &lt;!&ndash; 业务jar中过滤application.properties/yml文件,在jar包外控制 &ndash;&gt;-->
  224. <!-- <exclude>*.properties</exclude>-->
  225. <!-- <exclude>*.xml</exclude>-->
  226. <!-- <exclude>*.yml</exclude>-->
  227. <!-- </excludes>-->
  228. </configuration>
  229. </plugin>
  230. </plugins>
  231. </build>
  232. </project>