<?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>com.github.kmehrunes</groupId>
    <artifactId>javalin-jwt-parent</artifactId>
    <packaging>pom</packaging>
    <version>0.7.0</version>

    <modules>
        <module>javalin-jwt</module>
        <module>javalin-jwt-examples</module>
    </modules>

    <name>${project.groupId}:${project.artifactId}</name>
    <description>
        A basic JWT extension for Javalin which uses Auth0 Java JWT library
    </description>
    <url>https://github.com/kmehrunes/javalin-jwt</url>

    <developers>
        <developer>
            <name>Khaled Y.M.</name>
            <organizationUrl>https://github.com/kmehrunes</organizationUrl>
        </developer>
    </developers>

    <distributionManagement>
        <repository>
            <id>github</id>
            <name>GitHub AuthGuard Maven Packages</name>
            <url>https://maven.pkg.github.com/kmehrunes/javalin-jwt</url>
        </repository>
    </distributionManagement>

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

    <scm>
        <connection>scm:git:git://github.com/kmehrunes/javalin-jwt.git</connection>
        <developerConnection>scm:git:ssh://github.com:kmehrunes/javalin-jwt.git</developerConnection>
        <url>https://github.com/kmehrunes/javalin-jwt</url>
    </scm>

    <properties>
        <maven.compiler.source>9</maven.compiler.source>
        <maven.compiler.target>9</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <maven-source-plugin.version>3.2.0</maven-source-plugin.version>
        <maven-gpg-plugin.version>1.5</maven-gpg-plugin.version>
        <maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <executions>
                    <execution>
                        <id>default-compile</id>
                        <configuration>
                            <!-- compile everything to ensure module-info contains right entries -->
                            <!-- required when JAVA_HOME is JDK 8 or below -->
                            <jdkToolchain>
                                <version>9</version>
                            </jdkToolchain>
                            <release>9</release>
                        </configuration>
                    </execution>
                </executions>
                <!-- defaults for compile and testCompile -->
                <configuration>
                    <!-- jdkToolchain required when JAVA_HOME is JDK 9 or above -->
                    <jdkToolchain>
                        <version>[1.8,9)</version>
                    </jdkToolchain>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>prepare-release</id>

            <build>
                <plugins>
                    <!-- source -->
                    <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>

                    <!-- javadoc -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven-javadoc-plugin.version}</version>

                        <configuration>
                            <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
                            <detectJavaApiLink>false</detectJavaApiLink>
                        </configuration>

                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- GPG -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
