<!--
  ~ JBoss, Home of Professional Open Source.
  ~
  ~ Copyright 2014 Red Hat, Inc., and individual contributors
  ~ as indicated by the @author tags.
  ~
  ~ Licensed 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">
    <parent>
        <groupId>org.jboss</groupId>
        <artifactId>jboss-parent</artifactId>
        <version>51</version>
        <relativePath />
    </parent>

    <modelVersion>4.0.0</modelVersion>

    <groupId>org.jboss.slf4j</groupId>
    <artifactId>slf4j-jboss-logmanager</artifactId>
    <version>2.0.2.Final</version>
    <packaging>jar</packaging>

    <name>SLF4J: JBoss Log Manager</name>
    <description>An adaptor for SLF4J which delegates to the JBoss Log Manager</description>

    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>https://repository.jboss.org/licenses/apache-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>James R. Perkins</name>
            <email>jperkins@ibm.com</email>
            <organization>IBM</organization>
        </developer>
    </developers>


    <scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.url.inherit.append.path="false">
        <connection>scm:git:git://github.com/jboss-logging/slf4j-jboss-logmanager.git</connection>
        <developerConnection>scm:git:git@github.com:jboss-logging/slf4j-jboss-logmanager.git</developerConnection>
        <url>https://github.com/jboss-logging/slf4j-jboss-logmanager/tree/main/</url>
        <tag>2.0.2.Final</tag>
    </scm>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/jboss-logging/slf4j-jboss-logmanager/issues</url>
    </issueManagement>

    <properties>
        <!-- Require a minimum of Java 17 for compiling, but compile to 11 -->
        <jdk.min.version>17</jdk.min.version>
        <maven.compiler.release>11</maven.compiler.release>

        <!-- Dependency versions -->
        <version.org.jboss.logmanager>2.1.19.Final</version.org.jboss.logmanager>
        <version.org.slf4j>2.0.7</version.org.slf4j>

        <!-- Plugin versions -->
        <version.formatter.maven.plugin>2.23.0</version.formatter.maven.plugin>
        <version.impsort.maven.plugin>1.9.0</version.impsort.maven.plugin>

        <!-- Test dependencies -->
        <version.org.junit>5.10.3</version.org.junit>

        <!-- maven-release-plugin configuration -->
        <autoVersionSubmodules>true</autoVersionSubmodules>
        <releaseProfiles>jboss-release</releaseProfiles>
        <signTag>true</signTag>
        <tagNameFormat>@{project.version}</tagNameFormat>
        <arguments>-DskipTests</arguments>
        <!-- Do not push changes by default when using the maven-release-plugin:prepare -->
        <pushChanges>false</pushChanges>
        <!-- Use the local directory when using perform -->
        <localCheckout>true</localCheckout>
        <!--JBoss Nexus properties -->
        <nexus.repository.release>jboss-common</nexus.repository.release>
        <nexus.staging.tag>slf4j-jboss-logmanager-${project.version}</nexus.staging.tag>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${version.org.junit}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.jboss.logmanager</groupId>
            <artifactId>jboss-logmanager</artifactId>
            <version>${version.org.jboss.logmanager}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${version.org.slf4j}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Test Dependencies -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <systemPropertyVariables>
                        <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
                <version>${version.formatter.maven.plugin}</version>
                <dependencies>
                    <dependency>
                        <groupId>org.jboss.logging</groupId>
                        <artifactId>ide-config</artifactId>
                        <version>1.0.4.Final</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <!-- store outside of target to speed up formatting when mvn clean is used -->
                    <cachedir>.cache</cachedir>
                    <configFile>eclipse-code-formatter.xml</configFile>
                    <configXmlFile>wildfly-xml.properties</configXmlFile>
                    <lineEnding>LF</lineEnding>
                    <includeResources>true</includeResources>
                    <removeTrailingWhitespace>true</removeTrailingWhitespace>
                    <skip>${skipFormatting}</skip>
                </configuration>
                <executions>
                    <execution>
                        <id>format</id>
                        <goals>
                            <goal>format</goal>
                        </goals>
                        <phase>process-sources</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>net.revelc.code</groupId>
                <artifactId>impsort-maven-plugin</artifactId>
                <version>${version.impsort.maven.plugin}</version>
                <configuration>
                    <!-- store outside of target to speed up formatting when mvn clean is used -->
                    <cachedir>.cache</cachedir>
                    <groups>java.,javax.,jakarta.,org.,com.</groups>
                    <staticGroups>*</staticGroups>
                    <skip>${skipFormatting}</skip>
                    <removeUnused>true</removeUnused>
                </configuration>
                <executions>
                    <execution>
                        <id>sort-imports</id>
                        <goals>
                            <goal>sort</goal>
                        </goals>
                        <phase>process-sources</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>format-check</id>
            <build>
                <plugins>
                    <!-- Validate formatting -->
                    <plugin>
                        <groupId>net.revelc.code.formatter</groupId>
                        <artifactId>formatter-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>validate-format</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>validate</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>validate-format-resources</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>validate</goal>
                                </goals>
                                <configuration>
                                    <sourceDirectory>${project.basedir}/src/main/resources</sourceDirectory>
                                    <testSourceDirectory>${project.basedir}/src/test/resources</testSourceDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.revelc.code</groupId>
                        <artifactId>impsort-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>check-import-sort</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>check-import-sort-resources</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                                <configuration>
                                    <sourceDirectory>${project.basedir}/src/main/resources</sourceDirectory>
                                    <testSourceDirectory>${project.basedir}/src/test/resources</testSourceDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>slf4j-legacy-test</id>
            <activation>
                <property>
                    <name>legacy.test</name>
                </property>
            </activation>
            <properties>
                <version.org.slf4j>1.7.36</version.org.slf4j>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <skip>true</skip>
                            <skipMain>true</skipMain>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <failIfNoTests>true</failIfNoTests>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
