<?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>org.bsc.langgraph4j</groupId>
        <artifactId>langgraph4j-parent</artifactId>
        <version>1.7.3</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <artifactId>langgraph4j-studio-jetty</artifactId>
    <packaging>jar</packaging>
    <name>langgraph4j::studio::jetty</name>
    <description>an embed playground webapp to run a Langgraph4j workflow in visual way on Jetty platform</description>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <jetty.version>12.0.12</jetty.version>
        <jackson.version>2.17.2</jackson.version>
    </properties>

    <dependencyManagement>
        <dependencies>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.bsc.langgraph4j</groupId>
            <artifactId>langgraph4j-studio</artifactId>
            <version>${project.version}</version>
        </dependency>
<!--
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.0.1</version>
            <scope>provided</scope>
        </dependency>
-->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
        </dependency>

        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-server</artifactId>
            <version>${jetty.version}</version>
        </dependency>

        <dependency>
            <groupId>org.eclipse.jetty.ee10</groupId>
            <artifactId>jetty-ee10-servlet</artifactId>
            <version>${jetty.version}</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-jdk14</artifactId>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>dev.langchain4j</groupId>
            <artifactId>langchain4j</artifactId>
            <version>${langchain4j.version}</version>
        </dependency>

        <dependency>
            <groupId>org.bsc.langgraph4j</groupId>
            <artifactId>langgraph4j-agent-executor</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.github.victools</groupId>
            <artifactId>jsonschema-generator</artifactId>
            <version>4.36.0</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.module</groupId>
            <artifactId>jackson-module-jsonSchema</artifactId>
            <version>2.17.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.4.0</version>
                <configuration>
                    <webResources>
                        <resource>
                            <!-- this is relative to the pom.xml directory -->
                            <directory>src/main/webapp</directory>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <execution>
                        <!--
                        exec:java@test
                        mvn -pl studio/jetty exec:java@test -Djava.util.logging.config.file=studio/logging.properties
                        -->
                        <id>test</id>
                        <goals><goal>java</goal></goals>
                        <configuration>
                            <classpathScope>test</classpathScope>
                            <mainClass>org.bsc.langgraph4j.jetty.LangGraphStreamingServerTest</mainClass>
                        </configuration>
                    </execution>
                    <execution>
                        <!--
                        exec:java@agentexecutor
                        mvn -pl studio/jetty exec:java@agentexecutor -Djava.util.logging.config.file=studio/logging.properties
                        -->
                        <id>agentexecutor</id>
                        <goals><goal>java</goal></goals>
                        <configuration>
                            <classpathScope>test</classpathScope>
                            <mainClass>org.bsc.langgraph4j.AgentExecutorStreamingServer</mainClass>
                        </configuration>
                    </execution>
                    <execution>
                        <!--
                        exec:exec@adaptiverag
                        mvn -pl studio/jetty exec:java@adaptiverag -Djava.util.logging.config.file=studio/logging.properties
                        -->
                        <id>adaptiverag</id>
                        <goals><goal>java</goal></goals>
                        <configuration>
                            <classpathScope>test</classpathScope>
                            <mainClass>org.bsc.langgraph4j.AdaptiveRAGStreamingServer</mainClass>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.bsc.langgraph4j</groupId>
                        <artifactId>langgraph4j-core</artifactId>
                        <version>${project.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>
</project>
