<?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>net.octapass</groupId>
    <artifactId>log4j2-gcp-appender</artifactId>
    <version>0.0.4</version>
    <packaging>jar</packaging>

    <properties>
        <java.version>17</java.version>
        <maven.version>3.8.6</maven.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>

        <checkstyle.config.location>tools/checkstyle.xml</checkstyle.config.location>
        <github.url>https://github.com/octapass/log4j2-gcp-appender</github.url>
        <github.org.name>octapass</github.org.name>
        <github.repo.name>log4j2-gcp-appender</github.repo.name>

        <log4j.version>2.21.1</log4j.version>
        <gcp.logging.version>3.15.11</gcp.logging.version>
        <disruptor.version>4.0.0</disruptor.version>

        <checkstyle.version>10.9.3</checkstyle.version>
        <checkstyle.plugin.version>3.2.1</checkstyle.plugin.version>
        <compiler.plugin.version>3.11.0</compiler.plugin.version>
        <owasp.plugin.version>7.4.0</owasp.plugin.version>
        <gpg.plugin.version>3.0.1</gpg.plugin.version>
        <jxr.plugin.version>3.3.0</jxr.plugin.version>
        <enforcer.plugin.version>3.2.1</enforcer.plugin.version>
        <enforcer.rules.version>1.6.1</enforcer.rules.version>
        <clean.plugin.version>3.2.0</clean.plugin.version>
        <deploy.plugin.version>3.1.1</deploy.plugin.version>
        <install.plugin.version>3.1.1</install.plugin.version>
        <site.plugin.version>3.12.1</site.plugin.version>
        <versions.plugin.version>2.15.0</versions.plugin.version>
        <jar.plugin.version>3.3.0</jar.plugin.version>
        <resources.plugin.version>3.3.1</resources.plugin.version>
        <source.plugin.version>3.2.1</source.plugin.version>
        <surefire.plugin.version>3.0.0</surefire.plugin.version>
        <assembly.plugin.version>3.5.0</assembly.plugin.version>
        <buildnumber.plugin.version>3.0.0</buildnumber.plugin.version>
        <shade.plugin.version>3.5.1</shade.plugin.version>
        <release.plugin.version>3.0.1</release.plugin.version>
        <javadoc.plugin.version>3.4.1</javadoc.plugin.version>
    </properties>

    <name>Log4J 2 Google Cloud Platform Logging Appender</name>
    <url>${github.url}</url>
    <inceptionYear>2021</inceptionYear>

    <organization>
        <name>OctaPass AB</name>
        <url>https://octapass.com</url>
    </organization>

    <developers>
        <developer>
            <name>Andrei Petrenko</name>
            <email>andrei.petrenko@octapass.com</email>
            <organization>OctaPass AB</organization>
            <organizationUrl>https://octapass.com</organizationUrl>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <description>An Apache Log4J 2 appender that writes entries to Google Cloud Platform Logging.</description>
    <issueManagement>
        <system>github</system>
        <url>${github.url}/issues</url>
    </issueManagement>
    <scm>
        <url>https://github.com/${github.org.name}/${github.repo.name}</url>
        <connection>scm:git:git://github.com/${github.org.name}/${github.repo.name}.git</connection>
        <developerConnection>scm:git:git@github.com:${github.org.name}/${github.repo.name}.git</developerConnection>
        <tag>log4j2-gcp-appender-0.0.4</tag>
    </scm>
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.google.cloud</groupId>
                <artifactId>google-cloud-logging</artifactId>
                <version>${gcp.logging.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <version>${log4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-api</artifactId>
                <version>${log4j.version}</version>
            </dependency>

            <dependency>
                <groupId>com.lmax</groupId>
                <artifactId>disruptor</artifactId>
                <version>${disruptor.version}</version>
                <scope>runtime</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.cloud</groupId>
            <artifactId>google-cloud-logging</artifactId>
        </dependency>
        <dependency>
            <groupId>com.lmax</groupId>
            <artifactId>disruptor</artifactId>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>octapass-releng</id>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.owasp</groupId>
                            <artifactId>dependency-check-maven</artifactId>
                            <version>${owasp.plugin.version}</version>
                            <executions>
                                <execution>
                                    <goals>
                                        <goal>check</goal>
                                    </goals>
                                </execution>
                            </executions>
                        </plugin>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-gpg-plugin</artifactId>
                            <version>${gpg.plugin.version}</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>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-source-plugin</artifactId>
                            <version>${source.plugin.version}</version>
                            <executions>
                                <execution>
                                    <id>attach-sources</id>
                                    <goals>
                                        <goal>jar-no-fork</goal>
                                    </goals>
                                </execution>
                            </executions>
                        </plugin>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-javadoc-plugin</artifactId>
                            <version>${javadoc.plugin.version}</version>
                            <executions>
                                <execution>
                                    <id>attach-javadocs</id>
                                    <goals>
                                        <goal>jar</goal>
                                    </goals>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>

                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.owasp</groupId>
                        <artifactId>dependency-check-maven</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>${shade.plugin.version}</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <createDependencyReducedPom>true</createDependencyReducedPom>
                        <filters>
                            <filter>
                                <artifact>*:*</artifact>
                                <excludes>
                                    <exclude>META-INF/*.SF</exclude>
                                    <exclude>META-INF/*.DSA</exclude>
                                    <exclude>META-INF/*.RSA</exclude>
                                </excludes>
                            </filter>
                        </filters>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${enforcer.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>enforce-versions</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <bannedPlugins>
                                        <!-- will only display a warning but does not fail the build. -->
                                        <level>WARN</level>
                                        <excludes>
                                            <exclude>org.apache.maven.plugins:maven-verifier-plugin</exclude>
                                        </excludes>
                                        <message>Please consider using the maven-invoker-plugin
                                            (https://maven.apache.org/plugins/maven-invoker-plugin/)!
                                        </message>
                                    </bannedPlugins>
                                    <requireMavenVersion>
                                        <version>${maven.version}</version>
                                    </requireMavenVersion>
                                    <requireJavaVersion>
                                        <version>${java.version}</version>
                                    </requireJavaVersion>
                                </rules>
                            </configuration>
                        </execution>
                        <execution>
                            <id>enforce-ban-circular-dependencies</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <banCircularDependencies />
                                </rules>
                                <fail>true</fail>
                            </configuration>
                        </execution>
                        <execution>
                            <id>enforce-ban-duplicate-classes</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <banDuplicateClasses>
                                        <scopes>
                                            <scope>compile</scope>
                                            <scope>provided</scope>
                                        </scopes>
                                        <findAllDuplicates>true</findAllDuplicates>
                                        <ignoreWhenIdentical>true</ignoreWhenIdentical>
                                    </banDuplicateClasses>
                                </rules>
                                <fail>true</fail>
                            </configuration>
                        </execution>
                        <execution>
                            <id>require-utf-8</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <requireEncoding>
                                        <encoding>UTF-8</encoding>
                                        <excludes>src/main/resources/META-INF/services/*</excludes>
                                        <includes>src/main/resources/**,src/test/resources/**</includes>
                                    </requireEncoding>
                                </rules>
                                <failFast>false</failFast>
                            </configuration>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>extra-enforcer-rules</artifactId>
                            <version>${enforcer.rules.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${compiler.plugin.version}</version>
                    <configuration>
                        <release>${java.version}</release>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${jar.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${resources.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${release.plugin.version}</version>
                    <configuration>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <useReleaseProfile>false</useReleaseProfile>
                        <releaseProfiles>octapass-releng</releaseProfiles>
                        <goals>deploy</goals>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${surefire.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${assembly.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>make-assembly</id> <!-- this is used for inheritance merges -->
                            <phase>package</phase> <!-- bind to the packaging phase -->
                            <goals>
                                <goal>single</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${clean.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${deploy.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${install.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>${site.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jxr-plugin</artifactId>
                    <version>${jxr.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>${versions.plugin.version}</version>
                    <configuration>
                        <!--suppress UnresolvedMavenProperty -->
                        <rulesUri>file:///${session.executionRootDirectory}/tools/maven-version-rules.xml</rulesUri>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${checkstyle.plugin.version}</version>
                    <configuration>
                        <configLocation>${checkstyle.config.location}</configLocation>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>com.puppycrawl.tools</groupId>
                            <artifactId>checkstyle</artifactId>
                            <version>${checkstyle.version}</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <!--            <plugin>-->
            <!--                <groupId>org.apache.maven.plugins</groupId>-->
            <!--                <artifactId>maven-shade-plugin</artifactId>-->
            <!--            </plugin>-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
            </plugin>
            <!--            <plugin>-->
            <!--                <artifactId>maven-assembly-plugin</artifactId>-->
            <!--                <configuration>-->
            <!--                    <descriptorRefs>-->
            <!--                        <descriptorRef>jar-with-dependencies</descriptorRef>-->
            <!--                    </descriptorRefs>-->
            <!--                </configuration>-->
            <!--            </plugin>-->
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </reporting>

</project>