<!--
  ~ Copyright 2023 Red Hat, Inc.
  ~
  ~ Red Hat licenses this file to you under the Apache License, version 2.0
  ~ (the "License"); you may not use this file except in compliance with the
  ~ License.  You may obtain a copy of the License at:
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  ~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
  ~ License for the specific language governing permissions and limitations
  ~ under the License.
  -->

<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.reactiverse</groupId>
  <artifactId>reactiverse-contextual-logging</artifactId>
  <version>1.2.1</version>
  <packaging>jar</packaging>

  <name>${project.groupId}:${project.artifactId}</name>
  <description>Contextual logging for Vert.x applications.</description>
  <url>https://github.com/reactiverse/reactiverse-contextual-logging</url>

  <properties>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.compiler.source>1.8</maven.compiler.source>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <vertx.version>4.5.1</vertx.version>
    <logback.version>1.3.0</logback.version>
    <log4j2.version>2.22.1</log4j2.version>
    <slf4j.version>2.0.0</slf4j.version>
    <doc.outputDirectory>${project.build.directory}/generated-docs</doc.outputDirectory>
  </properties>

  <dependencies>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-core</artifactId>
      <version>${vertx.version}</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-codegen</artifactId>
      <version>${vertx.version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-codegen</artifactId>
      <classifier>processor</classifier>
      <version>${vertx.version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>${logback.version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <version>${log4j2.version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-core</artifactId>
      <version>${vertx.version}</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-web-client</artifactId>
      <version>${vertx.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.asciidoctor</groupId>
        <artifactId>asciidoctor-maven-plugin</artifactId>
        <version>2.2.5</version>
        <configuration>
          <attributes>
            <group-id>${project.groupId}</group-id>
            <artifact-id>${project.artifactId}</artifact-id>
            <version>${project.version}</version>
          </attributes>
          <outputDirectory>${doc.outputDirectory}</outputDirectory>
        </configuration>
        <executions>
          <execution>
            <id>output-html</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>process-asciidoc</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>3.2.5</version>
        <configuration>
          <useModulePath>false</useModulePath>
        </configuration>
        <executions>
          <execution>
            <id>jul</id>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
            <configuration>
              <systemProperties>
                <java.util.logging.config.file>${basedir}/src/test/jul/logging.properties
                </java.util.logging.config.file>
              </systemProperties>
              <classpathDependencyExcludes>
                <classpathDependencyExclude>org.slf4j:slf4j-api</classpathDependencyExclude>
                <classpathDependencyExclude>ch.qos.logback:logback-classic</classpathDependencyExclude>
                <classpathDependencyExclude>ch.qos.logback:logback-core</classpathDependencyExclude>
                <classpathDependencyExclude>org.apache.logging.log4j:log4j-api</classpathDependencyExclude>
                <classpathDependencyExclude>org.apache.logging.log4j:log4j-core</classpathDependencyExclude>
              </classpathDependencyExcludes>
            </configuration>
          </execution>
          <execution>
            <id>log4j2-context</id>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
            <configuration>
              <systemProperties>
                <log4j2.configurationFile>${basedir}/src/test/log4j2/context/log4j2.xml</log4j2.configurationFile>
              </systemProperties>
              <additionalClasspathElements>
                <additionalClasspathElement>${basedir}/src/test/log4j2/context/resources</additionalClasspathElement>
              </additionalClasspathElements>
              <classpathDependencyExcludes>
                <classpathDependencyExclude>org.slf4j:slf4j-api</classpathDependencyExclude>
                <classpathDependencyExclude>ch.qos.logback:logback-classic</classpathDependencyExclude>
                <classpathDependencyExclude>ch.qos.logback:logback-core</classpathDependencyExclude>
              </classpathDependencyExcludes>
            </configuration>
          </execution>
          <execution>
            <id>log4j2-converter</id>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
            <configuration>
              <systemProperties>
                <log4j2.configurationFile>${basedir}/src/test/log4j2/converter/log4j2.xml</log4j2.configurationFile>
              </systemProperties>
              <classpathDependencyExcludes>
                <classpathDependencyExclude>org.slf4j:slf4j-api</classpathDependencyExclude>
                <classpathDependencyExclude>ch.qos.logback:logback-classic</classpathDependencyExclude>
                <classpathDependencyExclude>ch.qos.logback:logback-core</classpathDependencyExclude>
              </classpathDependencyExcludes>
            </configuration>
          </execution>
          <execution>
            <id>logback</id>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
            <configuration>
              <systemProperties>
                <logback.configurationFile>${basedir}/src/test/logback/logback.xml</logback.configurationFile>
              </systemProperties>
              <classpathDependencyExcludes>
                <classpathDependencyExclude>org.apache.logging.log4j:log4j-api</classpathDependencyExclude>
                <classpathDependencyExclude>org.apache.logging.log4j:log4j-core</classpathDependencyExclude>
              </classpathDependencyExcludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.3.0</version>
        <configuration>
          <excludes>
            <exclude>examples/**</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.3.0</version>
        <configuration>
          <excludes>
            <exclude>examples/**</exclude>
          </excludes>
        </configuration>
        <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>3.6.3</version>
        <configuration>
          <excludePackageNames>examples</excludePackageNames>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.1.0</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <scm>
    <connection>scm:git:https://github.com/reactiverse/reactiverse-contextual-logging.git</connection>
    <developerConnection>scm:git:git@github.com:reactiverse/reactiverse-contextual-logging</developerConnection>
    <url>https://github.com/reactiverse/reactiverse-contextual-logging</url>
    <tag>HEAD</tag>
  </scm>

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

  <licenses>
    <license>
      <name>The Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Thomas Segismont</name>
      <url>https://github.com/tsegismont</url>
    </developer>
  </developers>

</project>
