<?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.soabase.structured-logger</groupId>
    <artifactId>structured-logger-parent</artifactId>
    <packaging>pom</packaging>
    <version>3</version>

    <modules>
        <module>structured-logger-core</module>
        <module>structured-logger-generator</module>
        <module>structured-logger-generator-test</module>
        <module>structured-logger-benchmark</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <jdk-version>1.8</jdk-version>

        <maven-compiler-plugin-version>3.8.0</maven-compiler-plugin-version>
        <maven-source-plugin-version>3.0.1</maven-source-plugin-version>
        <maven-deploy-plugin-version>3.0.0-M1</maven-deploy-plugin-version>
        <maven-install-plugin-version>3.0.0-M1</maven-install-plugin-version>
        <maven-shade-plugin-version>3.2.1</maven-shade-plugin-version>
        <maven-license-plugin-version>1.9.0</maven-license-plugin-version>
        <maven-javadoc-plugin-version>3.0.1</maven-javadoc-plugin-version>
        <maven-gpg-plugin-version>1.6</maven-gpg-plugin-version>
        <maven-release-plugin-version>2.5.3</maven-release-plugin-version>
        <maven-surefire-plugin-version>3.0.0-M1</maven-surefire-plugin-version>

        <slf4j-version>1.7.25</slf4j-version>
        <byte-buddy-version>1.9.10</byte-buddy-version>
        <junit-version>4.12</junit-version>
        <javapoet-version>1.11.1</javapoet-version>
        <assertj-version>3.12.0</assertj-version>
        <jackson-verison>2.9.8</jackson-verison>
        <jmh-profilers-version>0.1.4</jmh-profilers-version>
    </properties>

    <name>Soabase Structured Logger</name>
    <description>Structured Logging Facade for Java</description>
    <url>https://github.com/soabase/structured-logging</url>
    <inceptionYear>2019</inceptionYear>

    <organization>
        <name>Soabase Structured Logger</name>
        <url>https://github.com/soabase/structured-logging</url>
    </organization>

    <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>

    <developers>
        <developer>
            <name>Jordan Zimmerman</name>
            <email>jordan@jordanzimmerman.com</email>
            <timezone>-5</timezone>
            <url>https://github.com/randgalt/</url>
            <roles>
                <role>Author</role>
            </roles>
        </developer>
    </developers>

    <scm>
        <url>https://github.com/soabase/structured-logging</url>
        <connection>scm:git:https://github.com/soabase/structured-logging.git</connection>
        <developerConnection>scm:git:git@github.com:soabase/structured-logging.git</developerConnection>
        <tag>structured-logger-3</tag>
    </scm>

    <issueManagement>
        <system>Github</system>
        <url>https://github.com/soabase/structured-logging/issues</url>
    </issueManagement>

    <distributionManagement>
        <repository>
            <id>sonatype-nexus-staging</id>
            <name>Sonatype Nexus Staging</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus Snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j-version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>net.bytebuddy</groupId>
                <artifactId>byte-buddy</artifactId>
                <version>${byte-buddy-version}</version>
            </dependency>

            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit-version}</version>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>${slf4j-version}</version>
            </dependency>

            <dependency>
                <groupId>io.soabase.structured-logger</groupId>
                <artifactId>structured-logger-core</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>io.soabase.structured-logger</groupId>
                <artifactId>structured-logger-generator</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>com.squareup</groupId>
                <artifactId>javapoet</artifactId>
                <version>${javapoet-version}</version>
            </dependency>

            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj-version}</version>
            </dependency>

            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson-verison}</version>
            </dependency>

            <dependency>
                <groupId>com.github.biboudis</groupId>
                <artifactId>jmh-profilers</artifactId>
                <version>${jmh-profilers-version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin-version}</version>
                </plugin>

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

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${maven-install-plugin-version}</version>
                </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-shade-plugin</artifactId>
                    <version>${maven-shade-plugin-version}</version>
                </plugin>

                <plugin>
                    <groupId>com.mycila.maven-license-plugin</groupId>
                    <artifactId>maven-license-plugin</artifactId>
                    <version>${maven-license-plugin-version}</version>
                    <configuration>
                        <header>src/etc/header.txt</header>
                        <excludes>
                            <exclude>**/*.apt</exclude>
                            <exclude>**/*.md</exclude>
                            <exclude>**/*.graffle</exclude>
                            <exclude>**/.gitignore</exclude>
                            <exclude>**/*.json</exclude>
                            <exclude>**/.idea/**</exclude>
                            <exclude>**/DISCLAIMER</exclude>
                            <exclude>**/DEPENDENCIES</exclude>
                            <exclude>**/KEYS</exclude>
                            <exclude>**/LICENSE</exclude>
                            <exclude>**/NOTICE</exclude>
                            <exclude>**/README</exclude>
                            <exclude>**/CHANGES</exclude>
                            <exclude>**/RELEASE-NOTES</exclude>
                            <exclude>**/generated/**</exclude>
                            <exclude>**/test-file.txt</exclude>
                            <exclude>**/assets/**</exclude>
                            <exclude>**/examples/**</exclude>
                            <exclude>**/io/soabase/com/google/**</exclude>
                            <exclude>**/com/company/**</exclude>
                            <exclude>**/StreamFor.java
                            </exclude>    <!-- this is generated and too hard to get the header in -->
                        </excludes>
                        <strictCheck>true</strictCheck>
                    </configuration>
                    <executions>
                        <execution>
                            <id>license</id>
                            <goals>
                                <goal>check</goal>
                            </goals>
                            <phase>verify</phase>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin-version}</version>
                    <configuration>
                        <failOnError>false</failOnError>
                    </configuration>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

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

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven-release-plugin-version}</version>
                    <configuration>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <tagNameFormat>structured-logger-@{project.version}</tagNameFormat>
                    </configuration>
                </plugin>

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

        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${jdk-version}</source>
                    <target>${jdk-version}</target>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>com.mycila.maven-license-plugin</groupId>
                <artifactId>maven-license-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>oss</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <configuration>
                            <passphrase>${gpg.passphrase}</passphrase>
                            <useAgent>true</useAgent>
                        </configuration>
                        <executions>
                            <execution>
                                <id>gpg</id>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <phase>verify</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>benchmark</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <redirectTestOutputToFile>true</redirectTestOutputToFile>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
