<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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>

    <artifactId>logback-gson-layout</artifactId>
    <groupId>me.o-r-e</groupId>
    <version>0.0.1</version>
    <name>Logback JSON layout based on GSON</name>
    <description>Layout for Logback, which converts log events to JSON objects using GSON</description>
    <url>https://github.com/o-r-e/logback-gson-layout</url>

    <scm>
        <connection>scm:git:git://github.com/o-r-e/logback-gson-layout.git</connection>
        <developerConnection>scm:git:ssh://github.com:o-r-e/logback-gson-layout.git</developerConnection>
        <url>https://github.com/o-r-e/logback-gson-layout/tree/master</url>
    </scm>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://github.com/o-r-e/logback-gson-layout/blob/master/LICENSE</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Obuhov Roman</name>
            <email>obuhov.r@gmail.com</email>
            <organization>Github</organization>
            <organizationUrl>https://github.com/o-r-e</organizationUrl>
        </developer>
    </developers>

    <packaging>jar</packaging>

    <properties>
        <java.target.version>8</java.target.version>
        <java.target.version.full>1.${java.target.version}</java.target.version.full>
        <maven.compiler.source>${java.target.version.full}</maven.compiler.source>
        <maven.compiler.target>${java.target.version.full}</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <license.dir>${basedir}</license.dir>

        <logback.version>1.3.5</logback.version>
    </properties>

    <dependencies>
        <!-- [test] org.slf4j : slf4j-api -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>2.0.5</version>
            <scope>test</scope>
        </dependency>

        <!-- ch.qos.logback : logback-core -->
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
            <version>${logback.version}</version>
        </dependency>

        <!-- ch.qos.logback : logback-classic -->
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
        </dependency>

        <!-- com.google.code.gson : gson -->
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.10</version>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>deploy</id>

            <properties>
                <gpg.keyname>0x4A670616</gpg.keyname>
            </properties>

            <distributionManagement>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
            </distributionManagement>

            <build>
                <plugins>
                    <!-- org.apache.maven.plugins - maven-gpg-plugin -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <keyname>${gpg.keyname}</keyname>
                                    <passphraseServerId>${gpg.keyname}</passphraseServerId>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- org.sonatype.plugins - nexus-staging-maven-plugin -->
                    <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>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <sourceDirectory>src/main/java</sourceDirectory>
        <testSourceDirectory>src/test/java</testSourceDirectory>

        <plugins>
            <!-- org.apache.maven.plugins - maven-javadoc-plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.4.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- org.apache.maven.plugins - maven-source-plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>

                <executions>
                    <execution>
                        <id>sources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
