mirror of
https://gitee.com/mateos/mateclaw.git
synced 2026-09-13 11:13:43 +08:00
The KingbaseES JDBC driver is not on Maven Central; declaring it as a required runtime dependency broke the default build for anyone without the proprietary jar. Move it into an opt-in `kingbase` Maven profile (build with `mvn package -Pkingbase`). No Java code imports the driver classes — it is loaded at runtime via driver-class-name only, so the default build no longer needs it. Also drop `mateclaw.browser.ssrf-check-enabled: false` from the default application.yml: the code default is true, and disabling the SSRF guard globally is unrelated to KingbaseES support.
518 lines
21 KiB
XML
518 lines
21 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
<modelVersion>4.0.0</modelVersion>
|
|
|
|
<parent>
|
|
<groupId>vip.mate</groupId>
|
|
<artifactId>mateclaw</artifactId>
|
|
<version>${revision}</version>
|
|
<relativePath>../pom.xml</relativePath>
|
|
</parent>
|
|
|
|
<artifactId>mateclaw-server</artifactId>
|
|
<packaging>jar</packaging>
|
|
|
|
<name>MateClaw Server</name>
|
|
<description>MateClaw - Java+Vue Personal AI Assistant powered by Spring AI Alibaba</description>
|
|
|
|
<dependencies>
|
|
<!-- ===== MateClaw Plugin API ===== -->
|
|
<dependency>
|
|
<groupId>vip.mate</groupId>
|
|
<artifactId>mateclaw-plugin-api</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ===== Web MVC, excluding WebFlux to keep servlet mode ===== -->
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-web</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ===== Actuator - exposes Spring AI observation metrics (gen_ai.*) ===== -->
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ===== Spring AI Alibaba DashScope ===== -->
|
|
<!--
|
|
Version is managed centrally because this artifact is outside the Spring AI BOM.
|
|
Provides DashScope ChatModel, EmbeddingModel, and ImageModel support.
|
|
-->
|
|
<dependency>
|
|
<groupId>com.alibaba.cloud.ai</groupId>
|
|
<artifactId>spring-ai-alibaba-starter-dashscope</artifactId>
|
|
<!-- Exclude the transitive WebFlux starter to keep MVC mode. -->
|
|
<exclusions>
|
|
<exclusion>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-webflux</artifactId>
|
|
</exclusion>
|
|
</exclusions>
|
|
</dependency>
|
|
|
|
<!-- ===== Spring AI Alibaba Graph Core (StateGraph workflow engine) ===== -->
|
|
<dependency>
|
|
<groupId>com.alibaba.cloud.ai</groupId>
|
|
<artifactId>spring-ai-alibaba-graph-core</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ===== Spring AI OpenAI Compatible ===== -->
|
|
<dependency>
|
|
<groupId>org.springframework.ai</groupId>
|
|
<artifactId>spring-ai-openai</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ===== Spring AI Anthropic (Claude model support) ===== -->
|
|
<dependency>
|
|
<groupId>org.springframework.ai</groupId>
|
|
<artifactId>spring-ai-anthropic</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ===== Spring AI MCP Client (dynamic MCP server connection management) ===== -->
|
|
<!--
|
|
Pulls in the MCP core library while application code owns the McpSyncClient lifecycle.
|
|
-->
|
|
<dependency>
|
|
<groupId>org.springframework.ai</groupId>
|
|
<artifactId>spring-ai-starter-mcp-client</artifactId>
|
|
<exclusions>
|
|
<exclusion>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-webflux</artifactId>
|
|
</exclusion>
|
|
</exclusions>
|
|
</dependency>
|
|
|
|
<!-- ===== H2 embedded database (development) ===== -->
|
|
<dependency>
|
|
<groupId>com.h2database</groupId>
|
|
<artifactId>h2</artifactId>
|
|
<scope>runtime</scope>
|
|
</dependency>
|
|
|
|
<!-- ===== MySQL driver (production) ===== -->
|
|
<dependency>
|
|
<groupId>com.mysql</groupId>
|
|
<artifactId>mysql-connector-j</artifactId>
|
|
<scope>runtime</scope>
|
|
</dependency>
|
|
|
|
<!-- ===== MyBatis Plus, without JPA to avoid dual ORM conflicts ===== -->
|
|
<dependency>
|
|
<groupId>com.baomidou</groupId>
|
|
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
|
|
</dependency>
|
|
<!-- MyBatis Plus pagination support is split into a separate module. -->
|
|
<dependency>
|
|
<groupId>com.baomidou</groupId>
|
|
<artifactId>mybatis-plus-jsqlparser</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ===== Spring Security ===== -->
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-security</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ===== JJWT (JSON Web Token) ===== -->
|
|
<dependency>
|
|
<groupId>io.jsonwebtoken</groupId>
|
|
<artifactId>jjwt-api</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>io.jsonwebtoken</groupId>
|
|
<artifactId>jjwt-impl</artifactId>
|
|
<scope>runtime</scope>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>io.jsonwebtoken</groupId>
|
|
<artifactId>jjwt-jackson</artifactId>
|
|
<scope>runtime</scope>
|
|
</dependency>
|
|
|
|
<!-- ===== SpringDoc OpenAPI (Swagger UI for Spring MVC) ===== -->
|
|
<dependency>
|
|
<groupId>org.springdoc</groupId>
|
|
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ===== Hutool utilities ===== -->
|
|
<dependency>
|
|
<groupId>cn.hutool</groupId>
|
|
<artifactId>hutool-all</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ===== DingTalk Stream SDK (WebSocket long connection, no public IP required) ===== -->
|
|
<dependency>
|
|
<groupId>com.dingtalk.open</groupId>
|
|
<artifactId>dingtalk-stream</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ===== Lark Open API SDK (WebSocket long connection and event dispatch) ===== -->
|
|
<dependency>
|
|
<groupId>com.larksuite.oapi</groupId>
|
|
<artifactId>oapi-sdk</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ===== Caffeine cache for skill runtime caching ===== -->
|
|
<dependency>
|
|
<groupId>com.github.ben-manes.caffeine</groupId>
|
|
<artifactId>caffeine</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ===== SnakeYAML for SKILL.md frontmatter parsing ===== -->
|
|
<dependency>
|
|
<groupId>org.yaml</groupId>
|
|
<artifactId>snakeyaml</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ===== Lombok ===== -->
|
|
<dependency>
|
|
<groupId>org.projectlombok</groupId>
|
|
<artifactId>lombok</artifactId>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
|
|
<!-- ===== QR Code Generation (ZXing) ===== -->
|
|
<dependency>
|
|
<groupId>com.google.zxing</groupId>
|
|
<artifactId>core</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>com.google.zxing</groupId>
|
|
<artifactId>javase</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ===== Playwright (Browser Automation) ===== -->
|
|
<dependency>
|
|
<groupId>com.microsoft.playwright</groupId>
|
|
<artifactId>playwright</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ===== JDA (Discord Bot Gateway WebSocket long connection) ===== -->
|
|
<dependency>
|
|
<groupId>net.dv8tion</groupId>
|
|
<artifactId>JDA</artifactId>
|
|
<exclusions>
|
|
<!-- Exclude audio dependencies because voice features are not used. -->
|
|
<exclusion>
|
|
<groupId>club.minnced</groupId>
|
|
<artifactId>opus-java</artifactId>
|
|
</exclusion>
|
|
</exclusions>
|
|
</dependency>
|
|
|
|
<!-- ===== Spring WebSocket (Talk Mode) ===== -->
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-websocket</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ===== Slack SDK (Socket Mode and Web API) ===== -->
|
|
<dependency>
|
|
<groupId>com.slack.api</groupId>
|
|
<artifactId>slack-api-client</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>com.slack.api</groupId>
|
|
<artifactId>bolt-socket-mode</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.glassfish.tyrus.bundles</groupId>
|
|
<artifactId>tyrus-standalone-client</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ===== Apache POI (in-process .docx generation) ===== -->
|
|
<!--
|
|
Used by DocxRenderTool to render Markdown into a .docx in-JVM,
|
|
replacing the Node.js docx-js subprocess (3-5 min cold install).
|
|
-->
|
|
<dependency>
|
|
<groupId>org.apache.poi</groupId>
|
|
<artifactId>poi-ooxml</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ===== Apache Batik (SVG rasterization for docx image embedding) ===== -->
|
|
<!--
|
|
Used by MarkdownDocxRenderer to convert  image references
|
|
into PNG bytes that POI can embed via XWPFRun.addPicture(). Without this,
|
|
agents that produce architecture diagrams as inline SVG cannot get them
|
|
into the final .docx. Rasterization runs in-JVM (no rsvg-convert / cairo
|
|
dependency on the host).
|
|
-->
|
|
<dependency>
|
|
<groupId>org.apache.xmlgraphics</groupId>
|
|
<artifactId>batik-transcoder</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.apache.xmlgraphics</groupId>
|
|
<artifactId>batik-codec</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ===== jsoup (HTML cleanup for Wiki ingest) ===== -->
|
|
<!--
|
|
Used by WikiContentNormalizer to strip nav/footer/script/style/aside
|
|
and ad-class nodes from URL/HTML uploads before chunking. Small
|
|
(~430KB), no transitive deps, JVM-only, and safe for the desktop bundle.
|
|
-->
|
|
<dependency>
|
|
<groupId>org.jsoup</groupId>
|
|
<artifactId>jsoup</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ===== Apache Tika (Java-side last-resort document extractor) ===== -->
|
|
<!--
|
|
Wired as the FINAL fallback in DocumentExtractTool's PDF/DOCX/XLSX/PPTX
|
|
chains, after every system command + Python + POI-based path has failed.
|
|
Used in production primarily by Windows users without Python or poppler
|
|
installed; otherwise idle.
|
|
|
|
Pinned to the precise format modules the extractor calls directly. This
|
|
deliberately avoids `tika-parsers-standard-package`, which pulls in mail,
|
|
audio, archive, RTF / ODT, scientific, etc. (~80MB). Current footprint:
|
|
tika-core (~700KB) + tika-parser-pdf-module (PDFBox ~5MB) +
|
|
tika-parser-microsoft-module (POI-scratchpad ~10MB) is about 16MB.
|
|
-->
|
|
<dependency>
|
|
<groupId>org.apache.tika</groupId>
|
|
<artifactId>tika-core</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.apache.tika</groupId>
|
|
<artifactId>tika-parser-pdf-module</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.apache.tika</groupId>
|
|
<artifactId>tika-parser-microsoft-module</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ===== Markdown -> PDF rendering =====
|
|
Flying Saucer ships a single `flying-saucer-pdf` artifact that
|
|
writes PDF via OpenPDF (LGPL fork of iText). It does NOT depend on
|
|
PDFBox, so it sidesteps a version conflict with the existing
|
|
pdfbox dependency. CSS3 paged-media features (@page,
|
|
counter(page), counter(pages), @top-center / @bottom-center) are
|
|
supported, which the cover / header / footer rendering relies on.
|
|
|
|
commonmark-java is the reference CommonMark implementation,
|
|
actively maintained on a monthly cadence (vs. flexmark, whose
|
|
upstream stalled at 0.64.8 in 2023). It parses markdown into the
|
|
XHTML Flying Saucer consumes. The alternative LibreOffice path in
|
|
PdfRenderTool reuses MarkdownDocxRenderer + a soffice subprocess
|
|
and adds no dependencies of its own. -->
|
|
<dependency>
|
|
<groupId>org.xhtmlrenderer</groupId>
|
|
<artifactId>flying-saucer-pdf</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.commonmark</groupId>
|
|
<artifactId>commonmark</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.commonmark</groupId>
|
|
<artifactId>commonmark-ext-gfm-tables</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.commonmark</groupId>
|
|
<artifactId>commonmark-ext-yaml-front-matter</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.commonmark</groupId>
|
|
<artifactId>commonmark-ext-gfm-strikethrough</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.commonmark</groupId>
|
|
<artifactId>commonmark-ext-autolink</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ===== Database Migration (Flyway) ===== -->
|
|
<dependency>
|
|
<groupId>org.flywaydb</groupId>
|
|
<artifactId>flyway-core</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.flywaydb</groupId>
|
|
<artifactId>flyway-mysql</artifactId>
|
|
</dependency>
|
|
<!-- Flyway PostgreSQL support (used by KingbaseES as well since KingbaseES is PostgreSQL-compatible) -->
|
|
<dependency>
|
|
<groupId>org.flywaydb</groupId>
|
|
<artifactId>flyway-database-postgresql</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.postgresql</groupId>
|
|
<artifactId>postgresql</artifactId>
|
|
<version>42.7.7</version>
|
|
<scope>runtime</scope>
|
|
</dependency>
|
|
|
|
<!--
|
|
KingbaseES (人大金仓) JDBC driver is NOT on Maven Central, so it is
|
|
declared in the opt-in `kingbase` Maven profile instead of here.
|
|
The default build never resolves it. To build with KingbaseES:
|
|
1. install the driver: mvn install:install-file \
|
|
-Dfile=${KINGBASE_HOME}/Interface/jdbc/kingbase8-8.6.0.jar \
|
|
-DgroupId=com.kingbase8 -DartifactId=kingbase8 \
|
|
-Dversion=8.6.0 -Dpackaging=jar
|
|
2. build with the profile: mvn package -Pkingbase
|
|
No Java code imports com.kingbase8.* — the driver is loaded at
|
|
runtime via spring.datasource.driver-class-name only.
|
|
-->
|
|
|
|
<!-- ===== Spring Boot Test ===== -->
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-test</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
|
|
<!-- ===== ArchUnit architecture invariants =====
|
|
test-scope only, guards:
|
|
- every ToolCallback implementation overrides call(String, ToolContext)
|
|
so decorators (LocaleAwareToolCallback) cannot silently drop ChatOrigin
|
|
- CronJobRunner must not carry @Transactional
|
|
because it would silently fail under self-invocation
|
|
-->
|
|
<dependency>
|
|
<groupId>com.tngtech.archunit</groupId>
|
|
<artifactId>archunit-junit5</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
|
|
<!-- ShedLock: distributed lock for the cron scheduler so a
|
|
multi-instance deployment doesn't fire the same job N times.
|
|
JDBC mode reuses the existing DataSource, so there is no Redis dependency
|
|
on the desktop / single-node footprint. -->
|
|
<dependency>
|
|
<groupId>net.javacrumbs.shedlock</groupId>
|
|
<artifactId>shedlock-spring</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>net.javacrumbs.shedlock</groupId>
|
|
<artifactId>shedlock-provider-jdbc-template</artifactId>
|
|
</dependency>
|
|
|
|
<!-- Graph algorithms (community detection, shortest path, centrality)
|
|
used by the wiki page-to-page relevance and insights features. -->
|
|
<dependency>
|
|
<groupId>org.jgrapht</groupId>
|
|
<artifactId>jgrapht-core</artifactId>
|
|
</dependency>
|
|
|
|
<!-- PDF parsing for inline image extraction (wiki vision-in pipeline).
|
|
Used to walk PDPage resources and pull out PDImageXObject instances
|
|
for downstream captioning. -->
|
|
<dependency>
|
|
<groupId>org.apache.pdfbox</groupId>
|
|
<artifactId>pdfbox</artifactId>
|
|
</dependency>
|
|
|
|
<!-- Expression language used by the workflow compiler to evaluate
|
|
conditional step expressions and template variable references.
|
|
Restricted to a small subset (~20 operators / filters) at the
|
|
evaluator wrapper layer; arbitrary template includes / extends
|
|
are blocked. -->
|
|
<dependency>
|
|
<groupId>io.pebbletemplates</groupId>
|
|
<artifactId>pebble</artifactId>
|
|
</dependency>
|
|
</dependencies>
|
|
|
|
<build>
|
|
<plugins>
|
|
<plugin>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<goals>
|
|
<goal>repackage</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
<configuration>
|
|
<excludes>
|
|
<exclude>
|
|
<groupId>org.projectlombok</groupId>
|
|
<artifactId>lombok</artifactId>
|
|
</exclude>
|
|
</excludes>
|
|
</configuration>
|
|
</plugin>
|
|
<!-- Populate ${net.bytebuddy:byte-buddy-agent:jar} from the test
|
|
classpath so maven-surefire-plugin can attach it statically
|
|
(Mockito inline mock maker on JDK 21+ can no longer self-attach). -->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-dependency-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<id>resolve-test-classpath-properties</id>
|
|
<goals>
|
|
<goal>properties</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-surefire-plugin</artifactId>
|
|
<configuration>
|
|
<!-- Static agent attach for Mockito on JDK 21+. Without this, dynamic
|
|
agent loading raises ByteBuddyAgent.AttachmentTypeEvaluator errors
|
|
depending on the JVM's startup hardening, making tests pass on one
|
|
machine and fail on another. byte-buddy-agent rides in transitively
|
|
via mockito-core. -->
|
|
<argLine>-javaagent:${net.bytebuddy:byte-buddy-agent:jar}</argLine>
|
|
</configuration>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
|
|
<profiles>
|
|
<!--
|
|
Profile: focused test run for image / video generation features.
|
|
Activate with `mvn test -P media-gen` (or `mvn verify -P media-gen`).
|
|
Limits surefire to JUnit 5 tests carrying @Tag("media-gen") so the
|
|
full ~50-min suite is skipped when iterating on this surface.
|
|
Add a tag to a new test with @Tag("media-gen") to opt it in.
|
|
-->
|
|
<profile>
|
|
<id>media-gen</id>
|
|
<build>
|
|
<plugins>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-surefire-plugin</artifactId>
|
|
<configuration>
|
|
<groups>media-gen</groups>
|
|
</configuration>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
</profile>
|
|
|
|
<!--
|
|
Profile: KingbaseES (人大金仓) JDBC driver.
|
|
The driver is not published to Maven Central, so it is kept out of the
|
|
default build to keep `mvn package` resolvable for everyone. Install the
|
|
driver into the local repository, then build with `mvn package -Pkingbase`.
|
|
Runtime selection is via the `kingbase` Spring profile (application-kingbase.yml).
|
|
-->
|
|
<profile>
|
|
<id>kingbase</id>
|
|
<dependencies>
|
|
<dependency>
|
|
<groupId>com.kingbase8</groupId>
|
|
<artifactId>kingbase8</artifactId>
|
|
<version>8.6.0</version>
|
|
<scope>runtime</scope>
|
|
</dependency>
|
|
</dependencies>
|
|
</profile>
|
|
</profiles>
|
|
</project>
|