<?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>

    <groupId>com.easyagents</groupId>
    <artifactId>easy-agents</artifactId>
    <version>${revision}</version>
    <packaging>pom</packaging>

    <name>easy-agents</name>
    <url>https://agentsflex.com</url>
    <description>Easy-Agents is an elegant LLM Application Framework like LangChain with Java.</description>

    <modules>
        <module>easy-agents-bom</module>
        <module>easy-agents-core</module>
        <module>easy-agents-document</module>
        <module>easy-agents-rag</module>
        <module>easy-agents-chat</module>
        <module>easy-agents-store</module>
        <module>easy-agents-spring-boot-starter</module>
        <module>easy-agents-image</module>
        <module>easy-agents-rerank</module>
        <module>easy-agents-search-engine</module>
        <module>easy-agents-embedding</module>
        <module>easy-agents-tool</module>
        <module>easy-agents-mcp</module>
        <module>easy-agents-skill</module>
        <module>easy-agents-agent-runtime</module>
        <module>easy-agents-agui</module>
        <module>easy-agents-flow</module>
        <module>easy-agents-support</module>
    </modules>

    <properties>
        <revision>1.2.0-RC</revision>
        <maven.compiler.release>17</maven.compiler.release>
        <maven-flatten.version>1.3.0</maven-flatten.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <slf4j.version>1.7.29</slf4j.version>
        <junit.version>4.13.2</junit.version>
        <okhttp.version>4.9.3</okhttp.version>
        <fastjson2.version>2.0.58</fastjson2.version>
        <spring-boot.version>2.7.18</spring-boot.version>
        <kotlin.version>1.8.22</kotlin.version>
        <opentelemetry.version>1.51.0</opentelemetry.version>
        <agentscope.version>1.0.12</agentscope.version>
        <snakeyaml.version>2.6</snakeyaml.version>
        <commons-compress.version>1.28.0</commons-compress.version>
    </properties>


    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib</artifactId>
                <version>${kotlin.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib-jdk8</artifactId>
                <version>${kotlin.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib-common</artifactId>
                <version>${kotlin.version}</version>
            </dependency>
            <dependency>
                <groupId>com.squareup.okhttp3</groupId>
                <artifactId>okhttp</artifactId>
                <version>${okhttp.version}</version>
            </dependency>

            <dependency>
                <groupId>com.squareup.okhttp3</groupId>
                <artifactId>okhttp-sse</artifactId>
                <version>${okhttp.version}</version>
            </dependency>

            <dependency>
                <groupId>com.alibaba.fastjson2</groupId>
                <artifactId>fastjson2</artifactId>
                <version>${fastjson2.version}</version>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>jcl-over-slf4j</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
            </dependency>

            <dependency>
                <groupId>org.yaml</groupId>
                <artifactId>snakeyaml</artifactId>
                <version>${snakeyaml.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-compress</artifactId>
                <version>${commons-compress.version}</version>
            </dependency>

            <!--easy-agents dependency management-->
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-core</artifactId>
                <version>${revision}</version>
            </dependency>

            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-document-core</artifactId>
                <version>${revision}</version>
            </dependency>

            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-document-pdf</artifactId>
                <version>${revision}</version>
            </dependency>

            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-document-pptx</artifactId>
                <version>${revision}</version>
            </dependency>

            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-document-xlsx</artifactId>
                <version>${revision}</version>
            </dependency>

            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-rag-core</artifactId>
                <version>${revision}</version>
            </dependency>

            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-rag-ingestion</artifactId>
                <version>${revision}</version>
            </dependency>

            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-rag-enhance</artifactId>
                <version>${revision}</version>
            </dependency>

            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-rag-retrieval</artifactId>
                <version>${revision}</version>
            </dependency>

            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-bom</artifactId>
                <version>${revision}</version>
            </dependency>

            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-flow</artifactId>
                <version>${revision}</version>
            </dependency>

            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-support</artifactId>
                <version>${revision}</version>
            </dependency>


            <!--image model start-->
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-image-gitee</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-image-openai</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-image-qianfan</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-image-qwen</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-image-siliconflow</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-image-stability</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-image-tencent</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-image-volcengine</artifactId>
                <version>${revision}</version>
            </dependency>
            <!--image model end-->


            <!--chatModel start-->
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-chat-chatglm</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-chat-coze</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-chat-deepseek</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-chat-ollama</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-chat-openai</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-chat-qwen</artifactId>
                <version>${revision}</version>
            </dependency>
            <!--chatModel end-->

            <!-- rerank start -->
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-rerank</artifactId>
                <version>${revision}</version>
            </dependency>

            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-rerank-default</artifactId>
                <version>${revision}</version>
            </dependency>

            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-rerank-gitee</artifactId>
                <version>${revision}</version>
            </dependency>
            <!-- rerank end -->

            <!--embedding start-->
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-embedding-openai</artifactId>
                <version>${revision}</version>
            </dependency>

            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-embedding-qwen</artifactId>
                <version>${revision}</version>
            </dependency>

            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-embedding-ollama</artifactId>
                <version>${revision}</version>
            </dependency>
            <!--embedding end-->

            <!--store start-->
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-store-aliyun</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-store-milvus</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-store-chroma</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-store-elasticsearch</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-store-opensearch</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-store-pgvector</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-store-qcloud</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-store-qdrant</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-store-redis</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-store-vectorex</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-store-vectorexdb</artifactId>
                <version>${revision}</version>
            </dependency>
            <!--store end-->

            <!--starter start-->
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-spring-boot-starter</artifactId>
                <version>${revision}</version>
            </dependency>
            <!--starter end-->

            <!--starter start-->
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-search-engine</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-search-engine-service</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-search-engine-es</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-search-engine-lucene</artifactId>
                <version>${revision}</version>
            </dependency>
            <!--starter end-->


            <!-- OpenTelemetry API -->
            <dependency>
                <groupId>io.opentelemetry</groupId>
                <artifactId>opentelemetry-api</artifactId>
                <version>${opentelemetry.version}</version>
            </dependency>

            <!-- OpenTelemetry SDK（运行时） -->
            <dependency>
                <groupId>io.opentelemetry</groupId>
                <artifactId>opentelemetry-sdk</artifactId>
                <version>${opentelemetry.version}</version>
            </dependency>

            <!-- 导出到控制台（轻量级，无需第三方） -->
            <dependency>
                <groupId>io.opentelemetry</groupId>
                <artifactId>opentelemetry-exporter-logging</artifactId>
                <version>${opentelemetry.version}</version>
            </dependency>

            <!-- 导出到 OTLP -->
            <dependency>
                <groupId>io.opentelemetry</groupId>
                <artifactId>opentelemetry-exporter-otlp</artifactId>
                <version>${opentelemetry.version}</version>
            </dependency>


            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-mcp</artifactId>
                <version>${revision}</version>
            </dependency>

            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-skill</artifactId>
                <version>${revision}</version>
            </dependency>

            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-agent-runtime</artifactId>
                <version>${revision}</version>
            </dependency>

            <dependency>
                <groupId>com.easyagents</groupId>
                <artifactId>easy-agents-agui</artifactId>
                <version>${revision}</version>
            </dependency>

            <dependency>
                <groupId>io.agentscope</groupId>
                <artifactId>agentscope</artifactId>
                <version>${agentscope.version}</version>
            </dependency>

            <dependency>
                <groupId>io.agentscope</groupId>
                <artifactId>agentscope-extensions-agui</artifactId>
                <version>${agentscope.version}</version>
            </dependency>

        </dependencies>
    </dependencyManagement>


    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*</include>
                </includes>
            </resource>
        </resources>

        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.13.0</version>
                <configuration>
                    <release>${maven.compiler.release}</release>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>


            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>flatten-maven-plugin</artifactId>
                <version>${maven-flatten.version}</version>
                <configuration>
                    <updatePomFile>true</updatePomFile>
                    <flattenMode>oss</flattenMode>
                </configuration>
                <executions>
                    <execution>
                        <id>flatten</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>flatten</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>flatten.clean</id>
                        <phase>clean</phase>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.4.0</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.12.0</version>
                        <configuration>
                            <windowtitle>EasyAgents</windowtitle>
                            <doctitle>EasyAgents</doctitle>
                            <show>private</show>
                            <detectLinks>false</detectLinks>
                            <detectOfflineLinks>false</detectOfflineLinks>
                            <linksource>true</linksource>
                            <doclint>none</doclint>
                            <detectJavaApiLink>true</detectJavaApiLink>
                            <release>${maven.compiler.release}</release>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.11.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>true</autoPublish>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <!-- 跳过测试：mvn package -Dmaven.test.skip=true   -->
    <!-- 检测依赖最新版本：mvn versions:display-dependency-updates  -->
    <!-- 统一修改版本号：mvn versions:set -DnewVersion=3.0  -->
    <!-- mvn -N versions:update-child-modules  -->
    <!-- mvn versions:set -DnewVersion=2.0 -DprocessAllModules=true -DallowSnapshots=true -->

    <!-- mvn clean source:jar install -->
    <!-- mvn deploy -Dmaven.test.skip=true -e -P release -->

</project>
