<?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>xyz.398ja</groupId>
        <artifactId>kairos</artifactId>
        <version>0.2.0</version>
    </parent>
    <artifactId>kairos-app</artifactId>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>xyz.398ja</groupId>
            <artifactId>kairos-core</artifactId>
        </dependency>
        <dependency>
            <groupId>xyz.398ja</groupId>
            <artifactId>kairos-sentiment</artifactId>
        </dependency>
        <dependency>
            <groupId>xyz.398ja</groupId>
            <artifactId>kairos-trading</artifactId>
        </dependency>
        <dependency>
            <groupId>xyz.398ja</groupId>
            <artifactId>kairos-performance</artifactId>
        </dependency>
        <dependency>
            <groupId>xyz.398ja</groupId>
            <artifactId>kairos-dashboard</artifactId>
        </dependency>
        <dependency><groupId>xyz.398ja</groupId><artifactId>kairos-agent</artifactId></dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <!-- Build & push the container image to the 398ja Docker registry (mvn deploy / jib:build). -->
            <plugin>
                <groupId>com.google.cloud.tools</groupId>
                <artifactId>jib-maven-plugin</artifactId>
                <configuration>
                    <from>
                        <image>eclipse-temurin:21-jre</image>
                    </from>
                    <to>
                        <image>docker.398ja.xyz/kairos-app</image>
                        <tags>
                            <tag>${project.version}</tag>
                            <tag>latest</tag>
                        </tags>
                    </to>
                    <container>
                        <mainClass>${exec.mainClass}</mainClass>
                        <ports>
                            <port>8080</port>
                        </ports>
                        <jvmFlags>
                            <jvmFlag>-Xms256m</jvmFlag>
                            <jvmFlag>-Xmx512m</jvmFlag>
                        </jvmFlags>
                    </container>
                </configuration>
                <executions>
                    <execution>
                        <phase>deploy</phase>
                        <goals>
                            <goal>build</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
