<?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>org.openfolder</groupId>
    <artifactId>kotlin-asyncapi-parent</artifactId>
    <version>3.2.2</version>
    <packaging>pom</packaging>

    <name>Kotlin AsyncAPI Parent POM</name>
    <description>Parent POM for the Kotlin AsyncAPI framework</description>
    <url>https://github.com/asyncapi/kotlin-asyncapi</url>

    <organization>
        <name>AsyncAPI Initiative</name>
        <url>https://www.asyncapi.com/</url>
    </organization>

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

    <scm>
        <connection>scm:git:git://github.com/asyncapi/kotlin-asyncapi.git</connection>
        <developerConnection>scm:git:ssh://git@github.com:asyncapi/kotlin-asyncapi.git</developerConnection>
        <url>https://github.com/asyncapi/kotlin-asyncapi</url>
    </scm>

    <developers>
        <developer>
            <name>Lorenz Simon</name>
            <email>lorenz.simon.mail@gmail.com</email>
            <organization>AsyncAPI Initiative</organization>
            <organizationUrl>http://www.asyncapi.com</organizationUrl>
        </developer>
    </developers>

    <modules>
        <module>kotlin-asyncapi-core</module>
        <module>kotlin-asyncapi-spring-web</module>
        <module>kotlin-asyncapi-ktor</module>
        <module>kotlin-asyncapi-script</module>
        <module>kotlin-asyncapi-maven-plugin</module>
        <module>kotlin-asyncapi-annotation</module>
        <module>kotlin-asyncapi-examples</module>
        <module>kotlin-asyncapi-context</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <kotlin.compiler.languageVersion>1.9</kotlin.compiler.languageVersion>
        <kotlin.compiler.apiVersion>1.8</kotlin.compiler.apiVersion>
        <kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
        <java.version>21</java.version>
        <kotlin.version>2.2.21</kotlin.version>
        <jackson.version>2.21.2</jackson.version>
        <swagger.version>2.2.42</swagger.version>
        <classgraph.version>4.8.184</classgraph.version>
        <mockk.version>1.14.6</mockk.version>
        <jsonassert.version>1.5.3</jsonassert.version>
        <junit-jupiter.version>6.0.3</junit-jupiter.version>
        <assertj.version>3.27.7</assertj.version>
    </properties>

    <build>
        <finalName>${project.artifactId}</finalName>
        <sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
        <testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <version>${kotlin.version}</version>
                <executions>
                    <execution>
                        <id>compile</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

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

            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.14</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.5.0</version>
            </plugin>

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

            <plugin>
                <groupId>org.jetbrains.dokka</groupId>
                <artifactId>dokka-maven-plugin</artifactId>
                <version>2.1.0</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>javadocJar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>0.10.0</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>sign-artifacts</id>
            <activation>
                <property>
                    <name>env.GPG_PASSPHRASE</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.8</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencies>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib</artifactId>
            <version>${kotlin.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-test-junit</artifactId>
            <version>${kotlin.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.mockk</groupId>
            <artifactId>mockk-jvm</artifactId>
            <version>${mockk.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.openfolder</groupId>
                <artifactId>kotlin-asyncapi-spring-web</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.openfolder</groupId>
                <artifactId>kotlin-asyncapi-ktor</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.openfolder</groupId>
                <artifactId>kotlin-asyncapi-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.openfolder</groupId>
                <artifactId>kotlin-asyncapi-script</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.openfolder</groupId>
                <artifactId>kotlin-asyncapi-annotation</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.openfolder</groupId>
                <artifactId>kotlin-asyncapi-context</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.module</groupId>
                <artifactId>jackson-module-kotlin</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>io.swagger.core.v3</groupId>
                <artifactId>swagger-core-jakarta</artifactId>
                <version>${swagger.version}</version>
            </dependency>
            <dependency>
                <groupId>io.github.classgraph</groupId>
                <artifactId>classgraph</artifactId>
                <version>${classgraph.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-scripting-jvm-host</artifactId>
                <version>${kotlin.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${junit-jupiter.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${junit-jupiter.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.skyscreamer</groupId>
                <artifactId>jsonassert</artifactId>
                <version>${jsonassert.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
</project>
