<?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>io.quarkiverse.langchain4j</groupId>
        <artifactId>quarkus-langchain4j-llama3-java-parent</artifactId>
        <version>1.2.5</version>
    </parent>
    <artifactId>quarkus-langchain4j-llama3-java</artifactId>
    <name>Quarkus LangChain4j - Llama3 - Java - Runtime</name>
    <dependencies>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-arc</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkiverse.langchain4j</groupId>
            <artifactId>quarkus-langchain4j-core</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>io.smallrye.common</groupId>
            <artifactId>smallrye-common-resource</artifactId>
        </dependency>

        <dependency>
            <groupId>org.graalvm.sdk</groupId>
            <artifactId>graal-sdk</artifactId>
            <scope>provided</scope>
        </dependency>


        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-junit5-internal</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-extension-maven-plugin</artifactId>
                <version>${quarkus.version}</version>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>extension-descriptor</goal>
                        </goals>
                        <configuration>
                            <deployment>${project.groupId}:${project.artifactId}-deployment:${project.version}</deployment>
                            <devMode>
                                <jvmOptions>
                                    <add-modules>jdk.incubator.vector</add-modules>
                                    <enable-preview />
                                    <enable-native-access>ALL-UNNAMED</enable-native-access>
                                </jvmOptions>
                                <lockXxJvmOptions>TieredStopAtLevel</lockXxJvmOptions>
                                <lockJvmOptions>agentlib:jdwp</lockJvmOptions>
                            </devMode>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>io.quarkus</groupId>
                            <artifactId>quarkus-extension-processor</artifactId>
                        </path>
                    </annotationProcessorPaths>
                    <!--
                        In order for vector support to work on JDK 21+, we need to build the module with JDK 23,
                        because in that version Vector is no longer preview, so we build target and runtime versions
                        don't need to match (remember that preview features only work on the same runtime version as the target
                     -->
                    <source>21</source>
                    <target>21</target>
                    <release combine.self="override" />  <!-- make sure -release is not passed to javac-->
                    <compilerArgs>
                        <arg>--add-modules=jdk.incubator.vector</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate-codestart-jar</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <classesDirectory>${project.basedir}/src/main</classesDirectory>
                            <includes>
                                <include>codestarts/**</include>
                            </includes>
                            <classifier>codestarts</classifier>
                            <skipIfEmpty>true</skipIfEmpty>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
