pom.xml 12 KB

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