<?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>

    <groupId>dev.langchain4j</groupId>
    <artifactId>langchain4j-spring</artifactId>
    <version>1.0.0-beta4</version>
    <packaging>pom</packaging>

    <name>langchain4j-spring parent POM</name>
    <description>Parent POM for langchain4j-spring submodules</description>
    <url>https://github.com/langchain4j/langchain4j-spring</url>

    <modules>
        <module>langchain4j-spring-boot-starter</module>
        <module>langchain4j-spring-boot-tests</module>
        <module>langchain4j-http-client-spring-restclient</module>

        <module>langchain4j-anthropic-spring-boot-starter</module>
        <module>langchain4j-ollama-spring-boot-starter</module>
        <module>langchain4j-open-ai-spring-boot-starter</module>
        <module>langchain4j-azure-ai-search-spring-boot-starter</module>
        <module>langchain4j-azure-open-ai-spring-boot-starter</module>
        <module>langchain4j-voyage-ai-spring-boot-starter</module>
        <module>langchain4j-github-models-spring-boot-starter</module>
        <module>langchain4j-google-ai-gemini-spring-boot-starter</module>
        <module>langchain4j-vertex-ai-gemini-spring-boot-starter</module>
        <module>langchain4j-elasticsearch-spring-boot-starter</module>
        <module>langchain4j-milvus-spring-boot-starter</module>

        <module>langchain4j-reactor</module>
    </modules>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <spring.boot.version>3.3.8</spring.boot.version>
        <testcontainers.version>1.20.4</testcontainers.version>
        <tinylog.version>2.7.0</tinylog.version>
    </properties>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>dev.langchain4j</groupId>
                <artifactId>langchain4j-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- BOM for Spring Boot dependencies, including Framework, Reactor, Testcontainers, and Test -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring.boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- BOM for Testcontainers dependencies, overriding the version from the Spring Boot BOM -->
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>testcontainers-bom</artifactId>
                <version>${testcontainers.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.5.2</version>
            </plugin>

            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.7.0</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>false</autoReleaseAfterClose>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.3.1</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>3.11.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>3.5.2</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>io.sundr</groupId>
                <artifactId>sundr-maven-plugin</artifactId>
                <version>0.200.0</version>
                <executions>
                    <execution>
                        <inherited>false</inherited>
                        <goals>
                            <goal>generate-bom</goal>
                        </goals>
                        <configuration>
                            <boms>
                                <bom>
                                    <artifactId>langchain4j-spring-bom</artifactId>
                                    <name>LangChain4j Spring :: BOM</name>
                                    <description>Bill of Materials POM for getting full, complete set of compatible versions of LangChain4j Spring modules</description>
                                    <properties>
                                        <skipStagingRepositoryClose>true</skipStagingRepositoryClose>
                                        <sonar.skip>true</sonar.skip>
                                    </properties>
                                    <modules>
                                        <excludes>
                                            <exclude>*:langchain4j-spring-boot-tests</exclude>
                                        </excludes>
                                    </modules>
                                </bom>
                            </boms>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

    <licenses>
        <license>
            <name>Apache-2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>deep-learning-dynamo</id>
            <name>deep-learning-dynamo</name>
            <email>deeplearningdynamo@gmail.com</email>
            <url>https://github.com/deep-learning-dynamo</url>
        </developer>
        <developer>
            <id>kuraleta</id>
            <name>kuraleta</name>
            <email>digital.kuraleta@gmail.com</email>
            <url>https://github.com/kuraleta</url>
        </developer>
    </developers>

    <scm>
        <url>https://github.com/langchain4j/langchain4j-spring</url>
        <connection>scm:git:git://github.com/langchain4j/langchain4j-spring.git</connection>
        <developerConnection>scm:git:git@github.com:langchain4j/langchain4j-spring.git</developerConnection>
    </scm>

    <repositories>
        <repository>
            <id>ossrh-snapshots</id>
            <name>Sonatype Central Snapshots</name>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

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

    <profiles>

        <profile>
            <id>sign</id>
            <activation>
                <property>
                    <name>sign</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.7</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>compliance</id>
            <activation>
                <property>
                    <name>compliance</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.honton.chas</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <version>0.0.6</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>compliance</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

    </profiles>

</project>
