pom.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ~ Copyright (c) 2020 lttcai4cloud Authors. All Rights Reserved.
  4. ~
  5. ~ Licensed under the Apache License, Version 2.0 (the "License");
  6. ~ you may not use this file except in compliance with the License.
  7. ~ You may obtain a copy of the License at
  8. ~
  9. ~ http://www.apache.org/licenses/LICENSE-2.0
  10. ~
  11. ~ Unless required by applicable law or agreed to in writing, software
  12. ~ distributed under the License is distributed on an "AS IS" BASIS,
  13. ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. ~ See the License for the specific language governing permissions and
  15. ~ limitations under the License.
  16. -->
  17. <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
  18. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  19. <modelVersion>4.0.0</modelVersion>
  20. <groupId>cn.lttc.modules</groupId>
  21. <artifactId>lttcai</artifactId>
  22. <name>${project.artifactId}</name>
  23. <version>${revision}</version>
  24. <packaging>pom</packaging>
  25. <url>https://www.lttcai4cloud.com</url>
  26. <properties>
  27. <!-- 项目版本号 -->
  28. <revision>3.8.0</revision>
  29. <spring-boot.version>3.3.1</spring-boot.version>
  30. <spring-cloud.version>2023.0.3</spring-cloud.version>
  31. <spring-cloud-alibaba.version>2023.0.1.0</spring-cloud-alibaba.version>
  32. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  33. <maven.compiler.source>17</maven.compiler.source>
  34. <maven.compiler.target>17</maven.compiler.target>
  35. <spring-boot-admin.version>3.3.2</spring-boot-admin.version>
  36. <spring.authorization.version>1.3.1</spring.authorization.version>
  37. <screw.version>0.0.3</screw.version>
  38. <captcha.version>2.2.3</captcha.version>
  39. <aws.version>1.12.675</aws.version>
  40. <velocity.version>2.3</velocity.version>
  41. <velocity.tool.version>3.1</velocity.tool.version>
  42. <configuration.version>1.10</configuration.version>
  43. <jasypt.version>3.0.5</jasypt.version>
  44. <jaxb.version>4.0.5</jaxb.version>
  45. <knife4j.version>3.0.5</knife4j.version>
  46. <swagger.fox.version>3.0.0</swagger.fox.version>
  47. <xxl-job.version>2.4.0</xxl-job.version>
  48. <docker.plugin.version>0.44.0</docker.plugin.version>
  49. <docker.host>http://192.168.0.100:2375</docker.host>
  50. <docker.registry>registry.cn-shanghai.aliyuncs.com</docker.registry>
  51. <docker.namespace>lttcai4cloud</docker.namespace>
  52. <docker.username>username</docker.username>
  53. <docker.password>password</docker.password>
  54. <git.commit.plugin>9.0.1</git.commit.plugin>
  55. <spring.checkstyle.plugin>0.0.41</spring.checkstyle.plugin>
  56. <flatten-maven-plugin.version>1.6.0</flatten-maven-plugin.version>
  57. <maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
  58. </properties>
  59. <!-- 以下依赖 全局所有的模块都会引入 -->
  60. <dependencies>
  61. <!--配置文件处理器-->
  62. <dependency>
  63. <groupId>org.springframework.boot</groupId>
  64. <artifactId>spring-boot-configuration-processor</artifactId>
  65. <optional>true</optional>
  66. </dependency>
  67. <!--配置文件加解密-->
  68. <dependency>
  69. <groupId>com.github.ulisesbocchio</groupId>
  70. <artifactId>jasypt-spring-boot-starter</artifactId>
  71. <version>${jasypt.version}</version>
  72. </dependency>
  73. <!--监控-->
  74. <dependency>
  75. <groupId>org.springframework.boot</groupId>
  76. <artifactId>spring-boot-starter-actuator</artifactId>
  77. </dependency>
  78. <!--监控客户端-->
  79. <dependency>
  80. <groupId>de.codecentric</groupId>
  81. <artifactId>spring-boot-admin-starter-client</artifactId>
  82. <version>${spring-boot-admin.version}</version>
  83. </dependency>
  84. <!--Lombok-->
  85. <dependency>
  86. <groupId>org.projectlombok</groupId>
  87. <artifactId>lombok</artifactId>
  88. <scope>provided</scope>
  89. </dependency>
  90. <!-- JAVA 17 -->
  91. <dependency>
  92. <groupId>com.sun.xml.bind</groupId>
  93. <artifactId>jaxb-impl</artifactId>
  94. <version>${jaxb.version}</version>
  95. </dependency>
  96. <!--测试依赖-->
  97. <dependency>
  98. <groupId>org.springframework.boot</groupId>
  99. <artifactId>spring-boot-starter-test</artifactId>
  100. <scope>test</scope>
  101. </dependency>
  102. </dependencies>
  103. <modules>
  104. <module>lttcai-register</module>
  105. <module>lttcai-gateway</module>
  106. <module>lttcai-auth</module>
  107. <module>lttcai-upms</module>
  108. <module>lttcai-common</module>
  109. <module>lttcai-visual</module>
  110. <module>aichat</module>
  111. </modules>
  112. <dependencyManagement>
  113. <dependencies>
  114. <!--lttcai 公共版本定义-->
  115. <dependency>
  116. <groupId>cn.lttc.modules</groupId>
  117. <artifactId>lttcai-common-bom</artifactId>
  118. <version>${project.version}</version>
  119. <type>pom</type>
  120. <scope>import</scope>
  121. </dependency>
  122. <!-- spring boot 依赖 -->
  123. <dependency>
  124. <groupId>org.springframework.boot</groupId>
  125. <artifactId>spring-boot-dependencies</artifactId>
  126. <version>${spring-boot.version}</version>
  127. <type>pom</type>
  128. <scope>import</scope>
  129. </dependency>
  130. <!-- spring cloud 依赖 -->
  131. <dependency>
  132. <groupId>org.springframework.cloud</groupId>
  133. <artifactId>spring-cloud-dependencies</artifactId>
  134. <version>${spring-cloud.version}</version>
  135. <type>pom</type>
  136. <scope>import</scope>
  137. </dependency>
  138. <!-- spring cloud alibaba 依赖 -->
  139. <dependency>
  140. <groupId>com.alibaba.cloud</groupId>
  141. <artifactId>spring-cloud-alibaba-dependencies</artifactId>
  142. <version>${spring-cloud-alibaba.version}</version>
  143. <type>pom</type>
  144. <scope>import</scope>
  145. </dependency>
  146. </dependencies>
  147. </dependencyManagement>
  148. <build>
  149. <finalName>${project.name}</finalName>
  150. <resources>
  151. <resource>
  152. <directory>src/main/resources</directory>
  153. <filtering>true</filtering>
  154. </resource>
  155. </resources>
  156. <pluginManagement>
  157. <plugins>
  158. <plugin>
  159. <groupId>org.springframework.boot</groupId>
  160. <artifactId>spring-boot-maven-plugin</artifactId>
  161. <version>${spring-boot.version}</version>
  162. <configuration>
  163. <finalName>${project.build.finalName}</finalName>
  164. <layers>
  165. <enabled>true</enabled>
  166. </layers>
  167. </configuration>
  168. <executions>
  169. <execution>
  170. <goals>
  171. <goal>repackage</goal>
  172. </goals>
  173. </execution>
  174. </executions>
  175. </plugin>
  176. <plugin>
  177. <groupId>io.fabric8</groupId>
  178. <artifactId>docker-maven-plugin</artifactId>
  179. <version>${docker.plugin.version}</version>
  180. <configuration>
  181. <!-- Docker Remote Api-->
  182. <dockerHost>${docker.host}</dockerHost>
  183. <!-- Docker 镜像私服-->
  184. <registry>${docker.registry}</registry>
  185. <!-- 认证信息-->
  186. <authConfig>
  187. <push>
  188. <username>${docker.username}</username>
  189. <password>${docker.password}</password>
  190. </push>
  191. </authConfig>
  192. <images>
  193. <image>
  194. <!-- 镜像名称: 172.17.0.111/library/lttcai-gateway:2.6.3-->
  195. <name>${docker.registry}/${docker.namespace}/${project.name}:${project.version}</name>
  196. <build>
  197. <dockerFile>${project.basedir}/Dockerfile</dockerFile>
  198. </build>
  199. </image>
  200. </images>
  201. </configuration>
  202. </plugin>
  203. </plugins>
  204. </pluginManagement>
  205. <plugins>
  206. <!-- 统一 revision 版本 -->
  207. <plugin>
  208. <groupId>org.codehaus.mojo</groupId>
  209. <artifactId>flatten-maven-plugin</artifactId>
  210. <version>${flatten-maven-plugin.version}</version>
  211. <configuration>
  212. <flattenMode>resolveCiFriendliesOnly</flattenMode>
  213. <updatePomFile>true</updatePomFile>
  214. </configuration>
  215. <executions>
  216. <execution>
  217. <id>flatten</id>
  218. <phase>process-resources</phase>
  219. <goals>
  220. <goal>flatten</goal>
  221. </goals>
  222. </execution>
  223. <execution>
  224. <id>flatten.clean</id>
  225. <phase>clean</phase>
  226. <goals>
  227. <goal>clean</goal>
  228. </goals>
  229. </execution>
  230. </executions>
  231. </plugin>
  232. <plugin>
  233. <groupId>org.apache.maven.plugins</groupId>
  234. <artifactId>maven-compiler-plugin</artifactId>
  235. <version>${maven-compiler-plugin.version}</version>
  236. <configuration>
  237. <target>${maven.compiler.target}</target>
  238. <source>${maven.compiler.source}</source>
  239. <encoding>UTF-8</encoding>
  240. <parameters>true</parameters>
  241. </configuration>
  242. </plugin>
  243. <!--打包jar 与git commit 关联插件-->
  244. <plugin>
  245. <groupId>io.github.git-commit-id</groupId>
  246. <artifactId>git-commit-id-maven-plugin</artifactId>
  247. <version>${git.commit.plugin}</version>
  248. <executions>
  249. <execution>
  250. <id>get-the-git-infos</id>
  251. <phase>initialize</phase>
  252. </execution>
  253. </executions>
  254. <configuration>
  255. <failOnNoGitDirectory>false</failOnNoGitDirectory>
  256. <generateGitPropertiesFile>true</generateGitPropertiesFile>
  257. <!--因为项目定制了jackson的日期时间序列化/反序列化格式,因此这里要进行配置,不然通过management.info.git.mode=full进行完整git信息监控时会存在问题-->
  258. <dateFormat>yyyy-MM-dd HH:mm:ss</dateFormat>
  259. <includeOnlyProperties>
  260. <includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
  261. <includeOnlyProperty>^git.commit.(id|message|time).*$</includeOnlyProperty>
  262. </includeOnlyProperties>
  263. </configuration>
  264. </plugin>
  265. <!--
  266. 代码格式插件,默认使用spring 规则,可运行命令进行项目格式化:./mvnw spring-javaformat:apply 或 mvn spring-javaformat:apply,可在IDEA中安装插件以下插件进行自动格式化:
  267. https://repo1.maven.org/maven2/io/spring/javaformat/spring-javaformat-intellij-idea-plugin
  268. -->
  269. <plugin>
  270. <groupId>io.spring.javaformat</groupId>
  271. <artifactId>spring-javaformat-maven-plugin</artifactId>
  272. <version>${spring.checkstyle.plugin}</version>
  273. <executions>
  274. <execution>
  275. <phase>validate</phase>
  276. <inherited>true</inherited>
  277. </execution>
  278. </executions>
  279. </plugin>
  280. </plugins>
  281. </build>
  282. <profiles>
  283. <profile>
  284. <id>cloud</id>
  285. <properties>
  286. <!-- 环境标识,需要与配置文件的名称相对应 -->
  287. <profiles.active>dev</profiles.active>
  288. <nacos.username>nacos</nacos.username>
  289. <nacos.password>nacos</nacos.password>
  290. </properties>
  291. <activation>
  292. <!-- 默认环境 -->
  293. <activeByDefault>true</activeByDefault>
  294. </activation>
  295. </profile>
  296. <profile>
  297. <id>boot</id>
  298. <modules>
  299. <module>lttcai-boot</module>
  300. </modules>
  301. </profile>
  302. </profiles>
  303. </project>