<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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>
    <!-- sonatype parent pom -->
    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>

    <groupId>com.github.frtu.logs</groupId>
    <artifactId>logger-master-pom</artifactId>
    <version>1.1.5</version>
    <packaging>pom</packaging>

    <name>log platform java library Master pom</name>
    <description>log platform java library Master pom</description>

    <modules>
        <module>logger-libraries</module>
        <!--<module>sample-microservices</module>-->
        <module>tools</module>
    </modules>

    <url>https://github.com/frtu/log-platform/</url>
    <scm>
        <connection>scm:git:git@github.com:frtu/log-platform.git</connection>
        <developerConnection>scm:git:git@github.com:frtu/log-platform.git</developerConnection>
        <url>https://github.com/frtu/log-platform/tree/master</url>
        <tag>v1.1.5</tag>
    </scm>
    <developers>
        <developer>
            <name>Frédéric TU</name>
            <email>frederic.tu@gmail.com</email>
        </developer>
    </developers>
    <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>
    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus snapshot repository</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>sonatype-nexus-staging</id>
            <name>Sonatype Nexus release repository</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <!--===========================-->
        <java.version>1.8</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <!--===========================-->
        <opentelemetry.version>1.15.0</opentelemetry.version>
        <grpc.version>1.40.1</grpc.version>
        <!--<slf4j.version>1.7.25</slf4j.version>-->
        <!--<logback.version>1.2.3</logback.version>-->
        <logstash-logback-encoder.version>6.3</logstash-logback-encoder.version>
        <sndyuk.logback-more-appenders.version>1.7.1</sndyuk.logback-more-appenders.version>
        <micrometer.version>1.3.2</micrometer.version>
        <prometheus.simpleclient.version>0.8.1</prometheus.simpleclient.version>
        <!--===========================-->
        <!--<commons-lang3.version>3.5</commons-lang3.version>-->
        <!--<commons-io.version>2.4</commons-io.version>-->
        <!--https://search.maven.org/search?q=g:org.springframework.boot%20a:spring-boot-dependencies-->
        <!--<spring-boot.version>2.2.1.RELEASE</spring-boot.version>-->
        <!--<spring.version>5.3.2</spring.version>-->
        <!--===========================-->
        <!--<junit.version>4.12</junit.version>-->
        <!--<powermock.version>1.6.2</powermock.version>-->
        <!--<easymock.version>3.6</easymock.version>-->
        <!--===========================-->
        <base-pom.version>1.2.4</base-pom.version>
        <frtu-libs-java.version>1.2.3</frtu-libs-java.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- OpenTelemetry -->
            <dependency>
                <groupId>io.opentelemetry</groupId>
                <artifactId>opentelemetry-bom</artifactId>
                <version>${opentelemetry.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>io.opentelemetry</groupId>
                <artifactId>opentelemetry-bom-alpha</artifactId>
                <version>${opentelemetry.version}-alpha</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-bom</artifactId>
                <version>${grpc.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- Logging - JSON encoder -->
            <dependency>
                <groupId>net.logstash.logback</groupId>
                <artifactId>logstash-logback-encoder</artifactId>
                <version>${logstash-logback-encoder.version}</version>
            </dependency>
            <dependency>
                <groupId>com.sndyuk</groupId>
                <artifactId>logback-more-appenders</artifactId>
                <version>${sndyuk.logback-more-appenders.version}</version>
            </dependency>

            <!--http://micrometer.io/-->
            <dependency>
                <groupId>io.micrometer</groupId>
                <artifactId>micrometer-core</artifactId>
                <version>${micrometer.version}</version>
            </dependency>
            <dependency>
                <groupId>io.micrometer</groupId>
                <artifactId>micrometer-registry-prometheus</artifactId>
                <version>${micrometer.version}</version>
            </dependency>

            <!-- Prometheus -->
            <dependency>
                <groupId>io.prometheus</groupId>
                <artifactId>simpleclient</artifactId>
                <version>${prometheus.simpleclient.version}</version>
            </dependency>
            <dependency>
                <groupId>io.prometheus</groupId>
                <artifactId>simpleclient_common</artifactId>
                <version>${prometheus.simpleclient.version}</version>
            </dependency>
            <dependency>
                <groupId>io.prometheus</groupId>
                <artifactId>simpleclient_hotspot</artifactId>
                <version>${prometheus.simpleclient.version}</version>
            </dependency>
            <dependency>
                <groupId>io.prometheus</groupId>
                <artifactId>simpleclient_servlet</artifactId>
                <version>${prometheus.simpleclient.version}</version>
            </dependency>
            <!-- https://github.com/prometheus/pushgateway -->
            <dependency>
                <groupId>io.prometheus</groupId>
                <artifactId>simpleclient_pushgateway</artifactId>
                <version>${prometheus.simpleclient.version}</version>
            </dependency>

            <!--===========================-->
            <!--UNCOMMENT for override-->
            <!--===========================-->
            <!--<dependency>-->
            <!--    <groupId>org.springframework</groupId>-->
            <!--    <artifactId>spring-framework-bom</artifactId>-->
            <!--    <version>${spring.version}</version>-->
            <!--    <type>pom</type>-->
            <!--    <scope>import</scope>-->
            <!--</dependency>-->
            <!-- Spring Boot and Platform -->
            <!--<dependency>-->
            <!--<groupId>org.springframework.boot</groupId>-->
            <!--<artifactId>spring-boot-dependencies</artifactId>-->
            <!--<version>${spring-boot.version}</version>-->
            <!--<type>pom</type>-->
            <!--<scope>import</scope>-->
            <!--</dependency>-->

            <!--===========================-->
            <!--UNCOMMENT to remove parent-->
            <!--===========================-->
            <!-- Internal domain dependencies -->
            <dependency>
                <groupId>com.github.frtu.logs</groupId>
                <artifactId>logger-async</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.frtu.logs</groupId>
                <artifactId>logger-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.frtu.logs</groupId>
                <artifactId>logger-opentelemetry</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.frtu.logs</groupId>
                <artifactId>logger-metrics</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.frtu.logs</groupId>
                <artifactId>logger-security</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.frtu.archetype</groupId>
                <artifactId>base-pom</artifactId>
                <version>${base-pom.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.github.frtu.libs</groupId>
                <artifactId>lib-java-bom</artifactId>
                <version>${frtu-libs-java.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <plugins>
            <!-- JDK version -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                </configuration>
            </plugin>
            <!-- Generate source jar -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Generate Javadocs -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.4.0</version>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <show>private</show>
                    <nohelp>true</nohelp>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- RELEASE -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                    <releaseProfiles>release-sign-artifacts</releaseProfiles>
                    <preparationGoals>clean verify gpg:sign</preparationGoals>
                </configuration>
            </plugin>
        </plugins>
        <pluginManagement>
            <!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
            <plugins>
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.0.0</version>
                </plugin>
                <!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.0.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.0.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.1</version>
                    <configuration>
                        <mavenExecutorId>forked-path</mavenExecutorId>
                        <useReleaseProfile>false</useReleaseProfile>
                        <!--<arguments>${arguments}</arguments>-->
                        <arguments>-Psonatype-oss-release</arguments>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <profiles>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <configuration>
                            <useAgent>true</useAgent>
                            <!--<passphrase>${gpg.passphrase}</passphrase>-->
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
