<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->
<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>org.apache.flink</groupId>
        <artifactId>flink-agents-e2e-tests</artifactId>
        <version>0.3.1</version>
    </parent>

    <artifactId>flink-agents-end-to-end-tests-integration</artifactId>
    <name>Flink Agents : E2E Tests: Integration</name>

    <properties>
        <flink.1.20.version>1.20.5</flink.1.20.version>
        <flink.2.0.version>2.0.2</flink.2.0.version>
        <flink.2.1.version>2.1.3</flink.2.1.version>
        <flink.2.2.version>2.2.1</flink.2.2.version>
        <flink.2.3.version>2.3.0</flink.2.3.version>

        <flink.version>${flink.2.3.version}</flink.version>
        <flink.agents.dist.artifactId>flink-agents-dist-flink-2.3</flink.agents.dist.artifactId>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>${flink.agents.dist.artifactId}</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-streaming-java</artifactId>
            <version>${flink.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-table-api-java-bridge</artifactId>
            <version>${flink.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-table-planner_2.12</artifactId>
            <version>${flink.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-clients</artifactId>
            <version>${flink.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-connector-files</artifactId>
            <version>${flink.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-json</artifactId>
            <version>${flink.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-agents-integrations-chat-models-anthropic</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-agents-integrations-chat-models-azureai</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-agents-integrations-chat-models-openai</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-agents-integrations-chat-models-ollama</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-agents-integrations-embedding-models-ollama</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-agents-integrations-vector-stores-elasticsearch</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-runtime</artifactId>
            <version>${flink.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-test-utils</artifactId>
            <version>${flink.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>mockwebserver</artifactId>
            <version>4.12.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <!-- JDK 21+ Profile for Continuation API -->
        <profile>
            <id>java-21</id>
            <activation>
                <jdk>[21,)</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <!-- Add JVM args for JDK 21+ Continuation API access -->
                            <argLine>--add-exports java.base/jdk.internal.vm=ALL-UNNAMED</argLine>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- Flink 1.20 Profile -->
        <profile>
            <id>flink-1.20</id>
            <properties>
                <flink.version>${flink.1.20.version}</flink.version>
                <flink.agents.dist.artifactId>flink-agents-dist-flink-1.20</flink.agents.dist.artifactId>
            </properties>
            <dependencies>
                <!-- Flink 1.20 does not transitively provide log4j-core in test classpath,
                     needed for Slf4jEventLogger which uses log4j2 core APIs -->
                <dependency>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-api</artifactId>
                    <version>${log4j2.version}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-core</artifactId>
                    <version>${log4j2.version}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-slf4j-impl</artifactId>
                    <version>${log4j2.version}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>

        <!-- Flink 2.0 Profile -->
        <profile>
            <id>flink-2.0</id>
            <properties>
                <flink.version>${flink.2.0.version}</flink.version>
                <flink.agents.dist.artifactId>flink-agents-dist-flink-2.0</flink.agents.dist.artifactId>
            </properties>
        </profile>

        <!-- Flink 2.1 Profile -->
        <profile>
            <id>flink-2.1</id>
            <properties>
                <flink.version>${flink.2.1.version}</flink.version>
                <flink.agents.dist.artifactId>flink-agents-dist-flink-2.1</flink.agents.dist.artifactId>
            </properties>
        </profile>

        <!-- Flink 2.2 Profile -->
        <profile>
            <id>flink-2.2</id>
            <properties>
                <flink.version>${flink.2.2.version}</flink.version>
                <flink.agents.dist.artifactId>flink-agents-dist-flink-2.2</flink.agents.dist.artifactId>
            </properties>
        </profile>
    </profiles>

</project>
