<?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>ai.wanaku</groupId>
        <artifactId>apps</artifactId>
        <version>0.1.1-SNAPSHOT</version>
    </parent>

    <artifactId>wanaku-router-backend</artifactId>
    <name>Wanaku :: Apps :: Router Backend</name>

    <properties>
        <keycloak.docker.image>quay.io/keycloak/keycloak:26.6.1</keycloak.docker.image>
    </properties>

    <dependencies>
        <dependency>
            <groupId>ai.wanaku</groupId>
            <artifactId>core-util</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>io.quarkiverse.infinispan</groupId>
            <artifactId>quarkus-infinispan-embedded</artifactId>
            <version>${quarkus-infinispan-embedded.version}</version>
        </dependency>

        <dependency>
            <groupId>org.infinispan</groupId>
            <artifactId>infinispan-query</artifactId>
        </dependency>

        <dependency>
            <groupId>ai.wanaku</groupId>
            <artifactId>core-exchange</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>ai.wanaku</groupId>
            <artifactId>core-services-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>ai.wanaku</groupId>
            <artifactId>core-mcp-client</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>ai.wanaku.sdk</groupId>
            <artifactId>capabilities-api</artifactId>
        </dependency>

        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-rest</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-rest-jackson</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-arc</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-smallrye-openapi</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-smallrye-health</artifactId>
        </dependency>

        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-scheduler</artifactId>
        </dependency>

        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-messaging</artifactId>
        </dependency>

        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-picocli</artifactId>
        </dependency>

        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-container-image-jib</artifactId>
        </dependency>

        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-oidc</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkiverse.oidc-proxy</groupId>
            <artifactId>quarkus-oidc-proxy</artifactId>
            <version>${quarkus-oidc-proxy.version}</version>
        </dependency>

        <dependency>
            <groupId>io.quarkiverse.mcp</groupId>
            <artifactId>quarkus-mcp-server-http</artifactId>
            <version>${quarkus-mcp-server.version}</version>
        </dependency>

        <dependency>
            <groupId>io.quarkiverse.quinoa</groupId>
            <artifactId>quarkus-quinoa</artifactId>
            <version>${quarkus-quinoa.version}</version>
        </dependency>

        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ai.wanaku</groupId>
            <artifactId>core-util</artifactId>
            <version>${project.version}</version>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-junit-mockito</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>

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

        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-test-keycloak-server</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.quarkiverse.mcp</groupId>
            <artifactId>quarkus-mcp-server-test</artifactId>
            <version>${quarkus-mcp-server.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-netty-shaded</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>${quarkus.platform.group-id}</groupId>
                <artifactId>quarkus-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <excludes>
                        <exclude>**/*ManualTest.java</exclude>
                    </excludes>
                    <systemPropertyVariables>
                        <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                        <maven.home>${maven.home}</maven.home>
                        <keycloak.docker.image>${keycloak.docker.image}</keycloak.docker.image>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${maven-failsafe-plugin.version}</version>
                <configuration>
                    <excludes>
                        <exclude>**/*ManualTest.java</exclude>
                    </excludes>
                    <systemPropertyVariables>
                        <native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
                        <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                        <maven.home>${maven.home}</maven.home>
                        <keycloak.docker.image>${keycloak.docker.image}</keycloak.docker.image>
                    </systemPropertyVariables>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-service-templates</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.outputDirectory}/service-templates</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.basedir}/../../services/service-templates/src/main/services</directory>
                                    <filtering>false</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>dist</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <version>${maven-assembly-plugin.version}</version>
                        <configuration>
                            <attach>false</attach>
                            <appendAssemblyId>false</appendAssemblyId>
                            <outputDirectory>${distribution.directory}</outputDirectory>
                            <workDirectory>${project.build.directory}/assembly/work</workDirectory>
                        </configuration>
                        <executions>
                            <execution>
                                <id>make-distribution</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                                <configuration>
                                    <finalName>${project.artifactId}-${project.version}</finalName>
                                    <descriptors>
                                        <descriptor>src/main/assembly/assembly.xml</descriptor>
                                    </descriptors>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
