<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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>

    <groupId>bg.codexio.ai</groupId>
    <artifactId>openai-api</artifactId>
    <version>0.8.1.BETA</version>
    <packaging>pom</packaging>

    <name>Codexio Ltd. OpenAI API</name>
    <description>OpenAI API SDK with fluent interface for different AI models.</description>
    <url>https://github.com/CodexioLtd/openai-api-sdk</url>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>

        <developer>
            <name>Ivan Yonkov</name>
            <email>ivan.yonkov@codexio.bg</email>
            <organization>Codexio Ltd.</organization>
            <organizationUrl>https://codexio.bg</organizationUrl>
        </developer>

        <developer>
            <name>Yoana Borissova</name>
            <email>yoana.borissova@codexio.bg</email>
            <organization>Codexio Ltd.</organization>
            <organizationUrl>https://codexio.bg</organizationUrl>
        </developer>

    </developers>

    <scm>
        <connection>scm:git:git://github.com/CodexioLtd/openai-api-sdk.git</connection>
        <developerConnection>scm:git:ssh://github.com:CodexioLtd/openai-api-sdk.git</developerConnection>
        <url>https://github.com/CodexioLtd/openai-api-sdk/tree/master</url>
    </scm>

    <modules>
        <module>openai-api-models</module>
        <module>openai-api-payload</module>
        <module>openai-api-sdk</module>
        <module>openai-api-http</module>
        <module>openai-api-coverage</module>
        <module>openai-api-examples</module>
    </modules>


    <properties>
        <java.version>21</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>

        <junit.version>5.10.1</junit.version>
        <mockito.version>5.8.0</mockito.version>

        <nexus.plugin.version>1.6.13</nexus.plugin.version>
        <gpg.plugin.version>3.1.0</gpg.plugin.version>
        <javadoc.plugin.version>3.6.3</javadoc.plugin.version>
        <source.plugin.version>3.3.0</source.plugin.version>
        <jacoco.plugin.version>0.8.11</jacoco.plugin.version>

        <skipDeploy>false</skipDeploy>
    </properties>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${junit.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>

        </dependencies>
    </dependencyManagement>

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

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
        </dependency>
    </dependencies>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.2.3</version>
                <dependencies>
                    <dependency>
                        <groupId>org.junit.jupiter</groupId>
                        <artifactId>junit-jupiter-engine</artifactId>
                        <version>${junit.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>mvn-deploy</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>

            <build>
                <plugins>

                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${jacoco.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>jacoco-initialize</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>

                            <execution>
                                <id>jacoco-report</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${source.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${javadoc.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <failOnError>false</failOnError>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${gpg.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexus.plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <skipNexusStagingDeployMojo>${skipDeploy}</skipNexusStagingDeployMojo>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>

                </plugins>
            </build>
        </profile>
    </profiles>


</project>
