<?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">

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>9</version>
    </parent>

    <groupId>ru.playa.keycloak</groupId>
    <artifactId>keycloak-russian-providers</artifactId>
    <version>1.0.32</version>
    <modelVersion>4.0.0</modelVersion>
    <packaging>jar</packaging>

    <name>Keycloak identity providers for Russian Social Networks</name>
    <description>Yandex.Ru, Vk.Com, Mail.Ru and Ok.ru identity providers for Keycloak</description>
    <url>https://github.com/playa-ru/keycloak-russian-providers</url>

    <developers>
        <developer>
            <name>Anatoliy Pokhresniy</name>
            <email>a.pohresniy@playa.ru</email>
            <organization>Playa.Ru</organization>
            <organizationUrl>https://playa.ru</organizationUrl>
        </developer>
        <developer>
            <name>Sergey Bezrukov</name>
            <email>s.bezrukov@playa.ru</email>
            <organization>Playa.Ru</organization>
            <organizationUrl>https://playa.ru</organizationUrl>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <properties>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>1.8</maven.compiler.source>

        <version.javadoc.plugin>2.10.1</version.javadoc.plugin>
        <version.deploy.plugin>2.8.2</version.deploy.plugin>
        <version.source.plugin>2.4</version.source.plugin>
        <version.release.plugin>2.5.3</version.release.plugin>
        <version.assembly.plugin>3.1.0</version.assembly.plugin>
        <version.pmd.plugin>3.9.0</version.pmd.plugin>
        <version.checkstyle.plugin>3.0.0</version.checkstyle.plugin>
        <version.surefire.plugin>2.22.0</version.surefire.plugin>

        <version.keycloak>12.0.4</version.keycloak>

    </properties>

    <scm>
        <url>scm:git:git@github.com:playa-ru/keycloak-russian-providers.git</url>
        <developerConnection>scm:git:git@github.com:playa-ru/keycloak-russian-providers.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <dependencies>
        <dependency>
            <groupId>org.keycloak</groupId>
            <artifactId>keycloak-services</artifactId>
            <version>${version.keycloak}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.keycloak</groupId>
            <artifactId>keycloak-server-spi</artifactId>
            <version>${version.keycloak}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.keycloak</groupId>
            <artifactId>keycloak-server-spi-private</artifactId>
            <version>${version.keycloak}</version>
            <scope>provided</scope>
        </dependency>

    </dependencies>

    <build>

        <finalName>${project.artifactId}</finalName>

        <plugins>

            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>3.0.0-M5</version>
                <configuration>
                    <useSystemClassLoader>false</useSystemClassLoader>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${version.surefire.plugin}</version>
                <configuration>
                    <useSystemClassLoader>false</useSystemClassLoader>
                </configuration>
            </plugin>

            <plugin>

                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${version.checkstyle.plugin}</version>

                <configuration>
                    <consoleOutput>true</consoleOutput>
                    <configLocation>checkstyle.xml</configLocation>
                </configuration>

                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <phase>validate</phase>
                    </execution>
                </executions>

            </plugin>

            <plugin>

                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>${version.pmd.plugin}</version>

                <configuration>
                    <sourceEncoding>utf-8</sourceEncoding>
                    <minimumTokens>100</minimumTokens>
                    <targetJdk>1.8</targetJdk>
                    <rulesets>
                        <ruleset>pmd.xml</ruleset>
                    </rulesets>
                    <excludeRoots>
                        <excludeRoot>target/generated-sources</excludeRoot>
                    </excludeRoots>
                    <analysisCache>true</analysisCache>
                </configuration>

                <executions>
                    <execution>
                        <id>pmd-check</id>
                        <phase>test</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <excludeFromFailureFile>exclude-pmd.properties</excludeFromFailureFile>
                        </configuration>
                    </execution>
                    <execution>
                        <id>cpd-check</id>
                        <phase>test</phase>
                        <goals>
                            <goal>cpd-check</goal>
                        </goals>
                        <configuration>
                            <excludeFromFailureFile>exclude-cpd.properties</excludeFromFailureFile>
                        </configuration>
                    </execution>
                </executions>

            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${version.deploy.plugin}</version>
            </plugin>

            <!--<plugin>
                <artifactId>maven-release-plugin</artifactId>
                <version>${version.release.plugin}</version>
                <configuration>
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <preparationGoals>clean</preparationGoals>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-provider-gitexe</artifactId>
                        <version>1.9.5</version>
                    </dependency>
                </dependencies>
            </plugin>-->

        </plugins>

    </build>

    <!--<reporting>
        <excludeDefaults>true</excludeDefaults>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${version.javadoc.plugin}</version>
                <reportSets>
                    <reportSet>
                        <id>default</id>
                        <reports>
                            <report>javadoc</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>-->

    <distributionManagement>
        <repository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>docker</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.spotify</groupId>
                        <artifactId>dockerfile-maven-plugin</artifactId>
                        <version>1.4.0</version>
                        <configuration>
                            <repository>playaru/${artifactId}</repository>
                            <tag>${version.keycloak}</tag>
                            <useMavenSettingsForAuth>true</useMavenSettingsForAuth>
                        </configuration>
                        <executions>
                            <execution>
                                <id>default</id>
                                <goals>
                                    <goal>build</goal>
                                    <!--<goal>push</goal>-->
                                </goals>
                                <phase>package</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
