<?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>io.gitlab.klawru</groupId>
    <artifactId>parent-r2dbc-scheduler</artifactId>
    <version>0.1.0</version>
    <packaging>pom</packaging>

    <name>io.gitlab.klawru:parent-r2dbc-scheduler</name>
    <url>https://gitlab.com/klawru/r2dbc-scheduler</url>
    <description>Reactive cluster-friendly scheduler for Java</description>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Zhaulbaev Amir</name>
            <email>Klawru@gmail.com</email>
            <organizationUrl>https://gitlab.com/klawru/r2dbc-scheduler</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://gitlab.com:klawru/r2dbc-scheduler.git</connection>
        <developerConnection>scm:git:ssh://gitlab.com:klawru/r2dbc-scheduler.git</developerConnection>
        <url>https://gitlab.com/klawru/r2dbc-scheduler/-/tree/main</url>
    </scm>


    <modules>
        <module>r2dbc-scheduler</module>
        <module>r2dbc-scheduler-spring-boot-starter</module>
        <module>coverage</module>
    </modules>

    <properties>
        <jdk.version>11</jdk.version>
        <maven.compiler.source>${jdk.version}</maven.compiler.source>
        <maven.compiler.target>${jdk.version}</maven.compiler.target>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <sonar.host.url>https://sonarcloud.io</sonar.host.url>
        <sonar.organization>klawru</sonar.organization>
        <sonar.projectKey>klawru_r2dbc-scheduler</sonar.projectKey>
        <sonar.moduleKey>${project.groupId}:${project.artifactId}</sonar.moduleKey>
        <sonar.coverage.jacoco.xmlReportPaths>
            ${project.basedir}/coverage/target/site/jacoco-aggregate/jacoco.xml
        </sonar.coverage.jacoco.xmlReportPaths>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.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.5.0</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <source>${jdk.version}</source>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>2.11</version>
                <configuration>
                    <header>.license/apache-license-header.txt</header>
                    <aggregate>true</aggregate>
                    <strictCheck>true</strictCheck>
                    <excludes>
                        <exclude>**/pom.xml</exclude>
                        <exclude>LICENSE*</exclude>
                        <exclude>.license/**</exclude>
                        <exclude>**/*.properties</exclude>
                        <exclude>**/*.config</exclude>
                        <exclude>**/*.sql</exclude>
                        <exclude>.gitlab-ci.yml</exclude>
                        <exclude>ci_settings.xml</exclude>
                        <exclude>**/spring.factories</exclude>
                        <exclude>**/logback-test.xml</exclude>
                    </excludes>
                    <mapping>
                        <java>SLASHSTAR_STYLE</java>
                    </mapping>
                    <skipExistingHeaders>true</skipExistingHeaders>
                    <failIfMissing>true</failIfMissing>
                    <failIfUnknown>true</failIfUnknown>
                    <strictCheck>true</strictCheck>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonarsource.scanner.maven</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
                <version>3.9.1.2184</version>
            </plugin>
        </plugins>

        <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
            <plugins>
                <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.0.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.1</version>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.9</version>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.0.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
                <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
                <plugin>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.7.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>3.0.0</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>GitlabCI</id>
            <repositories>
                <repository>
                    <id>gitlab-maven</id>
                    <!--suppress MavenModelInspection -->
                    <url>https://gitlab.com/api/v4/projects/${env.CI_PROJECT_ID}/packages/maven</url>
                </repository>
            </repositories>

            <distributionManagement>
                <repository>
                    <id>gitlab-maven</id>
                    <!--suppress MavenModelInspection -->
                    <url>https://gitlab.com/api/v4/projects/${env.CI_PROJECT_ID}/packages/maven</url>
                </repository>
                <snapshotRepository>
                    <id>gitlab-maven</id>
                    <!--suppress MavenModelInspection -->
                    <url>https://gitlab.com/api/v4/projects/${env.CI_PROJECT_ID}/packages/maven</url>
                </snapshotRepository>
            </distributionManagement>
        </profile>
        <profile>
            <id>ossrh</id>
            <distributionManagement>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
            </distributionManagement>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.13</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-deploy-plugin</artifactId>
                        <configuration>
                            <!-- Отключаем плагин -->
                            <skip>true</skip>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
