pom.xml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  4. <modelVersion>4.0.0</modelVersion>
  5. <parent>
  6. <groupId>com.zsjz</groupId>
  7. <artifactId>zsjz-ai</artifactId>
  8. <version>1.0</version>
  9. <relativePath/> <!-- lookup parent from repository -->
  10. </parent>
  11. <artifactId>ai-server</artifactId>
  12. <name>ai-server</name>
  13. <description>ai-server</description>
  14. <properties>
  15. <java.version>25</java.version>
  16. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  17. <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  18. <tomlj.version>1.1.1</tomlj.version>
  19. <guava.version>33.4.8-jre</guava.version>
  20. <druid.version>1.2.22</druid.version>
  21. <commons-collections.version>3.2.1</commons-collections.version>
  22. <commons-io.version>2.21.0</commons-io.version>
  23. <commonmark.version>0.17.0</commonmark.version>
  24. <commons-compress.version>1.28.0</commons-compress.version>
  25. <testcontainers.version>1.21.4</testcontainers.version>
  26. <agentscope.version>2.0.5</agentscope.version>
  27. <redisson.version>4.2.0</redisson.version>
  28. <mcp-sdk.version>0.17.2</mcp-sdk.version>
  29. <mapstruct-plus.version>1.5.3</mapstruct-plus.version>
  30. <pgvector.version>0.1.6</pgvector.version>
  31. <djl.version>0.38.0</djl.version>
  32. <onnxruntime.version>1.30.0</onnxruntime.version>
  33. <!-- 文档解析扩展:Tika 显式钉版本;PP-OCR 走 rapidocr4j(模型内置);ASR 走 Vosk -->
  34. <tika.version>3.3.1</tika.version>
  35. <pdfbox.version>3.0.7</pdfbox.version>
  36. <rapidocr4j.version>1.0.3</rapidocr4j.version>
  37. <opencv.version>4.6.0-0</opencv.version>
  38. <vosk.version>0.3.45</vosk.version>
  39. </properties>
  40. <dependencyManagement>
  41. <dependencies>
  42. <dependency>
  43. <groupId>org.springframework.ai</groupId>
  44. <artifactId>spring-ai-bom</artifactId>
  45. <version>1.1.8</version>
  46. <type>pom</type>
  47. <scope>import</scope>
  48. </dependency>
  49. </dependencies>
  50. </dependencyManagement>
  51. <dependencies>
  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-validation</artifactId>
  59. </dependency>
  60. <dependency>
  61. <groupId>org.springframework.boot</groupId>
  62. <artifactId>spring-boot-starter-data-redis</artifactId>
  63. </dependency>
  64. <dependency>
  65. <groupId>org.springframework.boot</groupId>
  66. <artifactId>spring-boot-configuration-processor</artifactId>
  67. <optional>true</optional>
  68. </dependency>
  69. <dependency>
  70. <groupId>org.springframework.boot</groupId>
  71. <artifactId>spring-boot-starter-aop</artifactId>
  72. </dependency>
  73. <dependency>
  74. <groupId>org.springframework.boot</groupId>
  75. <artifactId>spring-boot-starter-test</artifactId>
  76. <scope>test</scope>
  77. </dependency>
  78. <dependency>
  79. <groupId>org.projectlombok</groupId>
  80. <artifactId>lombok</artifactId>
  81. <optional>true</optional>
  82. </dependency>
  83. <dependency>
  84. <groupId>io.agentscope</groupId>
  85. <artifactId>agentscope-harness</artifactId>
  86. <version>${agentscope.version}</version>
  87. <exclusions>
  88. <exclusion>
  89. <groupId>io.modelcontextprotocol.sdk</groupId>
  90. <artifactId>mcp</artifactId>
  91. </exclusion>
  92. </exclusions>
  93. </dependency>
  94. <!-- MCP 官方 Java SDK(biz-buddy 智能体体系的 MCP 双向能力),Jackson2 序列化适配本项目 -->
  95. <dependency>
  96. <groupId>io.modelcontextprotocol.sdk</groupId>
  97. <artifactId>mcp-core</artifactId>
  98. <version>${mcp-sdk.version}</version>
  99. </dependency>
  100. <dependency>
  101. <groupId>io.modelcontextprotocol.sdk</groupId>
  102. <artifactId>mcp-json-jackson2</artifactId>
  103. <version>${mcp-sdk.version}</version>
  104. </dependency>
  105. <dependency>
  106. <groupId>io.agentscope</groupId>
  107. <artifactId>agentscope-extensions-skill-postgresql-repository</artifactId>
  108. <version>${agentscope.version}</version>
  109. </dependency>
  110. <dependency>
  111. <groupId>io.agentscope</groupId>
  112. <artifactId>agentscope-extensions-model-openai</artifactId>
  113. <version>${agentscope.version}</version>
  114. </dependency>
  115. <dependency>
  116. <groupId>io.agentscope</groupId>
  117. <artifactId>agentscope-extensions-rag-simple</artifactId>
  118. <version>${agentscope.version}</version>
  119. <exclusions>
  120. <!-- 2.0.4 的 DashScope/Ollama 嵌入类已内置在本构件 io.agentscope.core.embedding.* 下,
  121. 独立模型构件本地仓库无 2.0.4 版,排除 -->
  122. <exclusion>
  123. <groupId>io.agentscope</groupId>
  124. <artifactId>agentscope-extensions-model-dashscope</artifactId>
  125. </exclusion>
  126. <exclusion>
  127. <groupId>io.agentscope</groupId>
  128. <artifactId>agentscope-extensions-model-ollama</artifactId>
  129. </exclusion>
  130. </exclusions>
  131. </dependency>
  132. <dependency>
  133. <groupId>io.agentscope</groupId>
  134. <artifactId>agentscope-extensions-redis</artifactId>
  135. <version>${agentscope.version}</version>
  136. </dependency>
  137. <!-- Redisson:biz-buddy 迁移代码的 RedisUtils/分布式锁底座;与 AgentScope 2.0.4 依赖的 4.2.0 对齐。
  138. 不再引入 redisson-spring-boot-starter(其 Spring Data 适配层与 Boot 3.5 / KEEPTTL 不兼容),
  139. Spring Data Redis 使用 Boot 默认 Lettuce,RedissonClient 由 RedissonConfig 手工装配。 -->
  140. <dependency>
  141. <groupId>org.redisson</groupId>
  142. <artifactId>redisson</artifactId>
  143. <version>${redisson.version}</version>
  144. </dependency>
  145. <!-- mapstruct-plus:biz-buddy BO/VO 转换(@AutoMapper / MapstructUtils) -->
  146. <dependency>
  147. <groupId>io.github.linpeilie</groupId>
  148. <artifactId>mapstruct-plus-spring-boot-starter</artifactId>
  149. <version>${mapstruct-plus.version}</version>
  150. </dependency>
  151. <!-- biz-buddy 迁移代码兼容层:StringUtils 基类与 Excel 导出 -->
  152. <dependency>
  153. <groupId>org.apache.commons</groupId>
  154. <artifactId>commons-lang3</artifactId>
  155. <version>3.18.0</version>
  156. </dependency>
  157. <dependency>
  158. <groupId>org.apache.fesod</groupId>
  159. <artifactId>fesod-sheet</artifactId>
  160. <version>2.0.2-incubating</version>
  161. </dependency>
  162. <dependency>
  163. <groupId>org.springframework.ai</groupId>
  164. <artifactId>spring-ai-tika-document-reader</artifactId>
  165. </dependency>
  166. <!-- Tika 显式钉版本(原先仅经 spring-ai-tika-document-reader 传递引入),
  167. 图片/扫描件/音视频解析都直接依赖它 -->
  168. <dependency>
  169. <groupId>org.apache.tika</groupId>
  170. <artifactId>tika-core</artifactId>
  171. <version>${tika.version}</version>
  172. </dependency>
  173. <dependency>
  174. <groupId>org.apache.tika</groupId>
  175. <artifactId>tika-parsers-standard-package</artifactId>
  176. <version>${tika.version}</version>
  177. </dependency>
  178. <!-- PP-OCRv4 本地推理(module/document):模型 det/cls/rec 直接内置在 jar 里,
  179. 字典在 rec 模型 metadata 中,运行期零下载。只调用 ONNX Runtime 公共 API,
  180. 与下方钉死的 onnxruntime 1.30.0 兼容,故排除它自带的 1.18.0 -->
  181. <dependency>
  182. <groupId>io.github.hzkitty</groupId>
  183. <artifactId>rapidocr4j</artifactId>
  184. <version>${rapidocr4j.version}</version>
  185. <exclusions>
  186. <exclusion>
  187. <groupId>com.microsoft.onnxruntime</groupId>
  188. <artifactId>onnxruntime</artifactId>
  189. </exclusion>
  190. </exclusions>
  191. </dependency>
  192. <!-- PP-OCR 前后处理依赖 OpenCV。这个 jar 一个文件内含 Windows x86_64、
  193. Linux x86_64/ARMv8/ARMv7、macOS 原生库 —— Windows 上构建、Linux 上运行
  194. (Linux 需 glibc ≥ 2.27) -->
  195. <dependency>
  196. <groupId>org.openpnp</groupId>
  197. <artifactId>opencv</artifactId>
  198. <version>${opencv.version}</version>
  199. </dependency>
  200. <!-- 扫描件 PDF 逐页判定:PDFBox 取每页文本层,缺文本页渲染位图交 OCR。
  201. 版本与 Tika 3.3.1 内部一致;jai-imageio / jbig2 用于渲染 CCITT、JBIG2 编码的扫描页 -->
  202. <dependency>
  203. <groupId>org.apache.pdfbox</groupId>
  204. <artifactId>pdfbox</artifactId>
  205. <version>${pdfbox.version}</version>
  206. </dependency>
  207. <dependency>
  208. <groupId>com.github.jai-imageio</groupId>
  209. <artifactId>jai-imageio-core</artifactId>
  210. <version>1.4.0</version>
  211. </dependency>
  212. <dependency>
  213. <groupId>org.apache.pdfbox</groupId>
  214. <artifactId>jbig2-imageio</artifactId>
  215. <version>3.0.4</version>
  216. </dependency>
  217. <!-- 音视频转写:jar 内置 win/linux/macOS x86_64 原生库;音频解码由外部 ffmpeg 完成 -->
  218. <dependency>
  219. <groupId>com.alphacephei</groupId>
  220. <artifactId>vosk</artifactId>
  221. <version>${vosk.version}</version>
  222. </dependency>
  223. <dependency>
  224. <groupId>org.postgresql</groupId>
  225. <artifactId>postgresql</artifactId>
  226. </dependency>
  227. <!-- pgvector Java SDK for PostgreSQL vector extension -->
  228. <dependency>
  229. <groupId>com.pgvector</groupId>
  230. <artifactId>pgvector</artifactId>
  231. <version>${pgvector.version}</version>
  232. </dependency>
  233. <!-- 本地嵌入模型推理:DJL HuggingFace 分词器(Rust 原生,加载 tokenizer.json,
  234. 传递引入 ai.djl:api)+ ONNX Runtime CPU(各平台 native 库内置 jar) -->
  235. <dependency>
  236. <groupId>ai.djl.huggingface</groupId>
  237. <artifactId>tokenizers</artifactId>
  238. <version>${djl.version}</version>
  239. </dependency>
  240. <dependency>
  241. <groupId>com.microsoft.onnxruntime</groupId>
  242. <artifactId>onnxruntime</artifactId>
  243. <version>${onnxruntime.version}</version>
  244. </dependency>
  245. <dependency>
  246. <groupId>com.zaxxer</groupId>
  247. <artifactId>HikariCP</artifactId>
  248. </dependency>
  249. <!-- DuckDB JDBC 驱动(数据源模块连接测试) -->
  250. <dependency>
  251. <groupId>org.duckdb</groupId>
  252. <artifactId>duckdb_jdbc</artifactId>
  253. <version>1.5.6.0</version>
  254. </dependency>
  255. <!-- Spring Batch(eds/bcp 迁移代码依赖,版本由 Spring Boot BOM 管理) -->
  256. <dependency>
  257. <groupId>org.springframework.boot</groupId>
  258. <artifactId>spring-boot-starter-batch</artifactId>
  259. </dependency>
  260. <!-- XStream(eds/bcp 迁移代码中 XML 序列化) -->
  261. <dependency>
  262. <groupId>com.thoughtworks.xstream</groupId>
  263. <artifactId>xstream</artifactId>
  264. <version>1.4.21</version>
  265. </dependency>
  266. <!-- MyBatis-Plus ServiceImpl:3.5.9+ 起从 extension 拆到 mybatis-plus-spring -->
  267. <dependency>
  268. <groupId>com.baomidou</groupId>
  269. <artifactId>mybatis-plus-spring</artifactId>
  270. <version>3.5.17</version>
  271. </dependency>
  272. <!-- zip4j(eds/bcp 迁移代码中压缩包处理) -->
  273. <dependency>
  274. <groupId>net.lingala.zip4j</groupId>
  275. <artifactId>zip4j</artifactId>
  276. <version>2.11.5</version>
  277. </dependency>
  278. <dependency>
  279. <groupId>com.baomidou</groupId>
  280. <artifactId>mybatis-plus-spring-boot3-starter</artifactId>
  281. <version>3.5.17</version>
  282. </dependency>
  283. <dependency>
  284. <groupId>com.baomidou</groupId>
  285. <artifactId>dynamic-datasource-spring-boot3-starter</artifactId>
  286. <version>4.5.0</version>
  287. </dependency>
  288. <!-- <dependency>
  289. <groupId>com.alibaba</groupId>
  290. <artifactId>druid</artifactId>
  291. <version>${druid.version}</version>
  292. </dependency>-->
  293. <dependency>
  294. <groupId>com.baomidou</groupId>
  295. <artifactId>mybatis-plus-jsqlparser</artifactId>
  296. <version>3.5.17</version>
  297. </dependency>
  298. <!-- Sa-Token 权限认证,在线文档:https://sa-token.com -->
  299. <dependency>
  300. <groupId>cn.dev33</groupId>
  301. <artifactId>sa-token-spring-boot3-starter</artifactId>
  302. <version>1.46.0</version>
  303. </dependency>
  304. <!-- BCrypt 密码加密(仅用加密类,不引入 Security 自动配置) -->
  305. <dependency>
  306. <groupId>org.springframework.security</groupId>
  307. <artifactId>spring-security-crypto</artifactId>
  308. </dependency>
  309. <dependency>
  310. <groupId>cn.dev33</groupId>
  311. <artifactId>sa-token-redis-jackson</artifactId>
  312. <version>1.46.0</version>
  313. </dependency>
  314. <dependency>
  315. <groupId>commons-collections</groupId>
  316. <artifactId>commons-collections</artifactId>
  317. <version>${commons-collections.version}</version>
  318. </dependency>
  319. <dependency>
  320. <groupId>commons-io</groupId>
  321. <artifactId>commons-io</artifactId>
  322. <version>${commons-io.version}</version>
  323. </dependency>
  324. <dependency>
  325. <groupId>org.commonmark</groupId>
  326. <artifactId>commonmark</artifactId>
  327. <version>${commonmark.version}</version>
  328. </dependency>
  329. <dependency>
  330. <groupId>org.apache.commons</groupId>
  331. <artifactId>commons-compress</artifactId>
  332. <version>${commons-compress.version}</version>
  333. </dependency>
  334. <dependency>
  335. <groupId>com.google.guava</groupId>
  336. <artifactId>guava</artifactId>
  337. <version>${guava.version}</version>
  338. </dependency>
  339. <!-- Source: https://mvnrepository.com/artifact/org.apache.fesod/fesod-sheet -->
  340. <dependency>
  341. <groupId>org.apache.fesod</groupId>
  342. <artifactId>fesod-sheet</artifactId>
  343. <version>2.0.2-incubating</version>
  344. <scope>compile</scope>
  345. </dependency>
  346. <!-- MapStruct 对象映射 -->
  347. <dependency>
  348. <groupId>org.mapstruct</groupId>
  349. <artifactId>mapstruct</artifactId>
  350. <version>1.6.3</version>
  351. </dependency>
  352. <dependency>
  353. <groupId>com.github.albfernandez</groupId>
  354. <artifactId>juniversalchardet</artifactId>
  355. <version>2.5.0</version>
  356. </dependency>
  357. <dependency>
  358. <groupId>cn.hutool</groupId>
  359. <artifactId>hutool-all</artifactId>
  360. <version>5.8.47</version>
  361. </dependency>
  362. <dependency>
  363. <groupId>net.java.dev.jna</groupId>
  364. <artifactId>jna</artifactId>
  365. <version>5.18.1</version>
  366. </dependency>
  367. <dependency>
  368. <groupId>com.yomahub</groupId>
  369. <artifactId>roguemap-core</artifactId>
  370. <version>1.1.7</version>
  371. </dependency>
  372. <!-- 全文检索(替代原嵌入式 Lucene 10.3.2):Elasticsearch 服务端版本须与
  373. Spring Boot 3.5 托管的客户端 8.18.x 匹配,单节点部署见 readme -->
  374. <dependency>
  375. <groupId>org.springframework.boot</groupId>
  376. <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
  377. </dependency>
  378. </dependencies>
  379. <build>
  380. <plugins>
  381. <plugin>
  382. <groupId>org.springframework.boot</groupId>
  383. <artifactId>spring-boot-maven-plugin</artifactId>
  384. <configuration>
  385. <!--
  386. 运行期工作目录固定为仓库根:PathConst 以 user.dir 为根解析 QingJian/ 资产与
  387. ./data/files,默认的模块目录(ai-server/)会让产物/附件写进 ai-server/QingJian
  388. 与既有数据分裂(历史产物预览 404)。见 QUICK_START §3.3/§5。
  389. -->
  390. <workingDirectory>${project.parent.basedir}</workingDirectory>
  391. </configuration>
  392. </plugin>
  393. <plugin>
  394. <groupId>org.apache.maven.plugins</groupId>
  395. <artifactId>maven-jar-plugin</artifactId>
  396. <executions>
  397. <!--
  398. 肥瘦包:
  399. - 主构件 ai-server-{version}.jar 仍由 spring-boot:repackage 产出(含依赖,java -jar 直接运行);
  400. - 本 execution 额外挂一个 ai-server-{version}-thin.jar(只含项目 classes/resources),
  401. manifest 写入 Main-Class 与 Class-Path: lib/,与 target/lib 同目录时 java -jar 可直接运行。
  402. -->
  403. <execution>
  404. <id>thin-jar</id>
  405. <phase>package</phase>
  406. <goals>
  407. <goal>jar</goal>
  408. </goals>
  409. <configuration>
  410. <classifier>thin</classifier>
  411. <archive>
  412. <manifest>
  413. <addClasspath>true</addClasspath>
  414. <classpathPrefix>lib/</classpathPrefix>
  415. <mainClass>com.zsjz.ai.App</mainClass>
  416. </manifest>
  417. </archive>
  418. </configuration>
  419. </execution>
  420. </executions>
  421. </plugin>
  422. <plugin>
  423. <groupId>org.apache.maven.plugins</groupId>
  424. <artifactId>maven-dependency-plugin</artifactId>
  425. <executions>
  426. <!-- 瘦包配套的依赖目录:target/lib,部署时与 -thin.jar 放在同一目录 -->
  427. <execution>
  428. <id>copy-libs</id>
  429. <phase>package</phase>
  430. <goals>
  431. <goal>copy-dependencies</goal>
  432. </goals>
  433. <configuration>
  434. <outputDirectory>${project.build.directory}/lib</outputDirectory>
  435. <!-- runtime = compile + runtime,排除 test/provided/optional -->
  436. <includeScope>runtime</includeScope>
  437. <overWriteReleases>false</overWriteReleases>
  438. <overWriteSnapshots>false</overWriteSnapshots>
  439. </configuration>
  440. </execution>
  441. </executions>
  442. </plugin>
  443. <plugin>
  444. <groupId>org.apache.maven.plugins</groupId>
  445. <artifactId>maven-compiler-plugin</artifactId>
  446. <executions>
  447. <execution>
  448. <id>default-compile</id>
  449. <phase>compile</phase>
  450. <goals>
  451. <goal>compile</goal>
  452. </goals>
  453. <configuration>
  454. <annotationProcessorPaths>
  455. <path>
  456. <groupId>org.projectlombok</groupId>
  457. <artifactId>lombok</artifactId>
  458. </path>
  459. <path>
  460. <groupId>org.springframework.boot</groupId>
  461. <artifactId>spring-boot-configuration-processor</artifactId>
  462. </path>
  463. <path>
  464. <groupId>org.mapstruct</groupId>
  465. <artifactId>mapstruct-processor</artifactId>
  466. <version>1.6.3</version>
  467. </path>
  468. <path>
  469. <groupId>io.github.linpeilie</groupId>
  470. <artifactId>mapstruct-plus-processor</artifactId>
  471. <version>${mapstruct-plus.version}</version>
  472. </path>
  473. <path>
  474. <groupId>org.projectlombok</groupId>
  475. <artifactId>lombok-mapstruct-binding</artifactId>
  476. <version>0.2.0</version>
  477. </path>
  478. </annotationProcessorPaths>
  479. </configuration>
  480. </execution>
  481. <execution>
  482. <id>default-testCompile</id>
  483. <phase>test-compile</phase>
  484. <goals>
  485. <goal>testCompile</goal>
  486. </goals>
  487. <configuration>
  488. <annotationProcessorPaths>
  489. <path>
  490. <groupId>org.projectlombok</groupId>
  491. <artifactId>lombok</artifactId>
  492. </path>
  493. <path>
  494. <groupId>org.mapstruct</groupId>
  495. <artifactId>mapstruct-processor</artifactId>
  496. <version>1.6.3</version>
  497. </path>
  498. </annotationProcessorPaths>
  499. </configuration>
  500. </execution>
  501. </executions>
  502. </plugin>
  503. </plugins>
  504. </build>
  505. </project>