pom.xml 20 KB

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