<?xml version="1.0" encoding="UTF-8"?>
<!--

    eXist-db Open Source Native XML Database
    Copyright (C) 2001 The eXist-db Authors

    info@exist-db.org
    http://www.exist-db.org

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

-->
<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.exist-db</groupId>
        <artifactId>exist-parent</artifactId>
        <version>7.0.0-beta5</version>
        <relativePath>../../exist-parent</relativePath>
    </parent>

    <artifactId>exist-vector</artifactId>
    <packaging>jar</packaging>

    <name>eXist-db Vector Embedding Extension</name>
    <description>eXist-db Vector Embedding Extension (ONNX local models)</description>

    <scm>
        <connection>scm:git:https://github.com/exist-db/exist.git</connection>
        <developerConnection>scm:git:https://github.com/exist-db/exist.git</developerConnection>
        <url>scm:git:https://github.com/exist-db/exist.git</url>
        <tag>HEAD</tag>
    </scm>

    <properties>
        <onnxruntime.version>1.29.0</onnxruntime.version>
        <onnxruntime.artifact>onnxruntime</onnxruntime.artifact>
        <djl.tokenizers.version>0.38.0</djl.tokenizers.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.exist-db</groupId>
            <artifactId>exist-core</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
        </dependency>

        <dependency>
            <groupId>com.microsoft.onnxruntime</groupId>
            <artifactId>${onnxruntime.artifact}</artifactId>
            <version>${onnxruntime.version}</version>
        </dependency>

        <dependency>
            <groupId>ai.djl.huggingface</groupId>
            <artifactId>tokenizers</artifactId>
            <version>${djl.tokenizers.version}</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <argLine>--add-modules jdk.incubator.vector --enable-native-access=ALL-UNNAMED -Dfile.encoding=${project.build.sourceEncoding}</argLine>
                    <systemPropertyVariables>
                        <exist.home>${project.basedir}/../../exist-core/target/test-classes</exist.home>
                        <log4j.configurationFile>${exist.log4j.testConfigurationFile}</log4j.configurationFile>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>analyze</id>
                        <goals>
                            <goal>analyze-only</goal>
                        </goals>
                        <configuration>
                            <failOnWarning>true</failOnWarning>
                            <ignoredUnusedDeclaredDependencies>
                                <ignoredUnusedDeclaredDependency>org.exist-db:exist-core</ignoredUnusedDeclaredDependency>
                                <ignoredUnusedDeclaredDependency>junit:junit</ignoredUnusedDeclaredDependency>
                            </ignoredUnusedDeclaredDependencies>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <!-- Profile gpu: mvn -P gpu ... uses onnxruntime_gpu for CUDA (requires NVIDIA GPU + CUDA) -->
    <profiles>
        <profile>
            <id>gpu</id>
            <properties>
                <onnxruntime.artifact>onnxruntime_gpu</onnxruntime.artifact>
            </properties>
        </profile>
    </profiles>
</project>
