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

    <name>Kotlin Spark API: Parent</name>
    <description>Parent project for Kotlin for Apache Spark</description>
    <groupId>org.jetbrains.kotlinx.spark</groupId>
    <artifactId>kotlin-spark-api-parent</artifactId>
    <version>1.0.3</version>
    <packaging>pom</packaging>

    <properties>
        <kotlin.version>1.5.30</kotlin.version>
        <dokka.version>1.4.32</dokka.version>
        <atrium.version>0.16.0</atrium.version>
        <kotest.version>4.6.0</kotest.version>
        <kotest-extension-allure.version>1.0.1</kotest-extension-allure.version>
        <spark3.version>3.2.0</spark3.version>

        <!-- Plugin versions -->
        <allure-maven.version>2.10.0</allure-maven.version>
        <jacoco-maven-plugin.version>0.8.7</jacoco-maven-plugin.version>
        <klaxon.version>5.5</klaxon.version>
        <license-maven-plugin.version>2.0.0</license-maven-plugin.version>
        <maven-assembly-plugin.version>3.3.0</maven-assembly-plugin.version>
        <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
        <maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
        <maven-enforcer-plugin.version>3.0.0-M3</maven-enforcer-plugin.version>
        <maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
        <maven-site-plugin.version>3.9.1</maven-site-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
        <nexus-staging-plugin.version>1.6.8</nexus-staging-plugin.version>
        <scala-maven-plugin.version>4.5.6</scala-maven-plugin.version>
    </properties>

    <modules>
        <module>kotlin-spark-api/common</module>
        <module>dummy</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib-jdk8</artifactId>
                <version>${kotlin.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-reflect</artifactId>
                <version>${kotlin.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlinx.spark</groupId>
                <artifactId>kotlin-spark-api-common</artifactId>
                <version>${project.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>3.0.0-M1</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${nexus-staging-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>io.qameta.allure</groupId>
                    <artifactId>allure-maven</artifactId>
                    <version>${allure-maven.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco-maven-plugin.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>report</id>
                            <goals>
                                <goal>report</goal>
                            </goals>
                            <phase>prepare-package</phase>
                        </execution>
                    </executions>
                </plugin>
                <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>
                            <phase>compile</phase>
                            <configuration>
                                <myIncremental>true</myIncremental>
                                <jvmTarget>1.8</jvmTarget>
                                <args>
                                    <arg>-Xopt-in=kotlin.RequiresOptIn</arg>
                                    <arg>-XXLanguage:+InlineClasses</arg>
                                </args>
                            </configuration>
                        </execution>
                        <execution>
                            <id>test-compile</id>
                            <goals>
                                <goal>test-compile</goal>
                            </goals>
                            <phase>test-compile</phase>
                            <configuration>
                                <myIncremental>true</myIncremental>
                                <jvmTarget>1.8</jvmTarget>
                                <args>
                                    <arg>-Xopt-in=kotlin.RequiresOptIn</arg>
                                    <arg>-XXLanguage:+InlineClasses</arg>
                                </args>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>${maven-site-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                    <configuration>
                        <enableProcessChecker>native</enableProcessChecker>
                    </configuration>
                </plugin>
                <plugin>
                    <!-- see http://davidb.github.com/scala-maven-plugin -->
                    <groupId>net.alchim31.maven</groupId>
                    <artifactId>scala-maven-plugin</artifactId>
                    <version>${scala-maven-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>${license-maven-plugin.version}</version>
                <configuration>
                    <roots>
                        <root>src/main/</root>
                        <root>src/test/</root>
                    </roots>
                    <licenseName>apache_v2</licenseName>
                    <processStartTag>=LICENSE=</processStartTag>
                    <processEndTag>=LICENSE END=</processEndTag>
                    <sectionDelimiter>----------</sectionDelimiter>
                </configuration>
                <executions>
                    <execution>
                        <id>first</id>
                        <goals>
                            <goal>update-file-header</goal>
                        </goals>
                        <phase>process-sources</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven-enforcer-plugin.version}</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.5.4</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${maven-deploy-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <localCheckout>true</localCheckout>
                    <pushChanges>false</pushChanges>
                    <mavenExecutorId>forked-path</mavenExecutorId>
                    <releaseProfiles>scala-2.12,release-sign</releaseProfiles>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>${nexus-staging-plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>false</autoReleaseAfterClose>
                    <stagingProgressTimeoutMinutes>20</stagingProgressTimeoutMinutes>
                </configuration>
            </plugin>
        </plugins>
    </build>


    <url>http://maven.apache.org</url>
    <inceptionYear>2019</inceptionYear>
    <organization>
        <name>JetBrains</name>
        <url>https://www.jetbrains.com/</url>
    </organization>

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

    <developers>
        <developer>
            <id>asm0dey</id>
            <name>Pasha Finkelshteyn</name>
            <email>asm0dey@jetbrains.com</email>
            <timezone>GMT+3</timezone>
        </developer>
        <developer>
            <id>vitaly.khudobakhshov</id>
            <name>Vitaly Khudobakhshov</name>
            <email>vitaly.khudobakhshov@jetbrains.com</email>
            <timezone>GMT+3</timezone>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:https://github.com/JetBrains/kotlin-spark-api.git</connection>
        <url>https://github.com/JetBrains/kotlin-spark-api</url>
        <tag>1.0.3</tag>
    </scm>
    <distributionManagement>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>scala-2.12</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <modules>
                <module>pom_2.12.xml</module>
            </modules>
        </profile>
        <profile>
            <id>release-sign</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <phase>verify</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
