<?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>co.elastic.logging</groupId>
    <artifactId>ecs-logging-java-parent</artifactId>
    <version>1.0.1</version>
    <name>${project.groupId}:${project.artifactId}</name>
    <modules>
        <module>ecs-logging-core</module>
        <module>log4j-ecs-layout</module>
        <module>log4j2-ecs-layout</module>
        <module>logback-ecs-encoder</module>
        <module>jul-ecs-formatter</module>
        <module>jboss-logmanager-ecs-formatter</module>
        <module>log4j2-legacy-tests</module>
        <module>log4j-legacy-tests</module>
        <module>logback-legacy-tests</module>
    </modules>
    <packaging>pom</packaging>
    <inceptionYear>2019</inceptionYear>
    <organization>
        <name>Elastic NV</name>
        <url>https://www.elastic.co</url>
    </organization>

    <description>Centralized logging for Java applications with the Elastic stack made easy</description>
    <url>https://github.com/elastic/ecs-logging-java</url>

    <licenses>
        <license>
            <name>The Apache Software 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:elastic/ecs-logging-java.git</connection>
        <developerConnection>scm:git:git@github.com:elastic/ecs-logging-java.git</developerConnection>
        <url>https://github.com/elastic/ecs-logging-java</url>
        <tag>v1.0.1</tag>
    </scm>

    <developers>
        <developer>
            <name>Elastic</name>
            <url>https://discuss.elastic.co/</url>
            <organization>Elastic NV</organization>
            <organizationUrl>https://www.elastic.co</organizationUrl>
        </developer>
    </developers>

    <properties>
        <version.junit-jupiter>5.5.1</version.junit-jupiter>
        <maven.compiler.target>6</maven.compiler.target>
        <maven.compiler.testTarget>10</maven.compiler.testTarget>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <parent.base.dir>${project.basedir}</parent.base.dir>
        <maven-deploy-plugin.skip>false</maven-deploy-plugin.skip>
    </properties>

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

    <profiles>
        <!--
        This profile is needed to be active in IntelliJ
        as it does not understand that the tests have a different target version
        -->
        <profile>
            <id>IntelliJ</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <!-- https://youtrack.jetbrains.com/issue/IDEA-85478 -->
                <property>
                    <name>idea.maven.embedder.version</name>
                </property>
            </activation>
            <properties>
                <maven.compiler.target>${maven.compiler.testTarget}</maven.compiler.target>
            </properties>
        </profile>
        <profile>
            <id>gpg</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>gpg</releaseProfiles>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
                <configuration>
                    <skip>${maven-deploy-plugin.skip}</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>generate-source-jar</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.1.1</version>
                <configuration>
                    <additionalOptions>-html5</additionalOptions>
                    <source>${maven.compiler.target}</source>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Check that we don't accidentally use features only available in Java 8+ -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>animal-sniffer-maven-plugin</artifactId>
                <version>1.18</version>
                <executions>
                    <execution>
                        <id>signature-check</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <signature>
                        <groupId>org.codehaus.mojo.signature</groupId>
                        <artifactId>java16</artifactId>
                        <version>1.0</version>
                    </signature>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
                <configuration>
                    <enableAssertions>true</enableAssertions>
                    <trimStackTrace>false</trimStackTrace>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.junit.platform</groupId>
                        <artifactId>junit-platform-surefire-provider</artifactId>
                        <version>1.1.1</version>
                    </dependency>
                    <dependency>
                        <groupId>org.junit.jupiter</groupId>
                        <artifactId>junit-jupiter-engine</artifactId>
                        <version>${version.junit-jupiter}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>${maven.compiler.target}</source>
                    <target>${maven.compiler.target}</target>
                    <testSource>${maven.compiler.testTarget}</testSource>
                    <testTarget>${maven.compiler.testTarget}</testTarget>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.coderplus.maven.plugins</groupId>
                <artifactId>copy-rename-maven-plugin</artifactId>
                <version>1.0</version>
                <executions>
                    <execution>
                        <id>copy-file</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <fileSets>
                                <fileSet>
                                    <sourceFile>../LICENSE</sourceFile>
                                    <destinationFile>target/classes/META-INF/LICENSE</destinationFile>
                                </fileSet>
                            </fileSets>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>1.19</version>
                <configuration>
                    <verbose>false</verbose>
                    <licenseName>apache2_license</licenseName>
                    <licenseResolver>file:///${parent.base.dir}/licenses</licenseResolver>
                    <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
                    <failOnMissingHeader>true</failOnMissingHeader>
                    <failOnNotUptodateHeader>true</failOnNotUptodateHeader>
                    <projectName>Java ECS logging</projectName>
                    <organizationName>Elastic and contributors</organizationName>
                    <roots>
                        <root>src/main/java</root>
                        <root>src/test/java</root>
                    </roots>
                </configuration>
                <executions>
                    <execution>
                        <id>first</id>
                        <goals>
                            <goal>update-file-header</goal>
                        </goals>
                        <phase>process-sources</phase>
                    </execution>
                    <execution>
                        <id>license-header-check</id>
                        <goals>
                            <goal>check-file-header</goal>
                        </goals>
                        <phase>verify</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${version.junit-jupiter}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>3.12.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>[2.9.10.3,)</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

</project>