<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.adobexp</groupId>
        <artifactId>central-maven-parent</artifactId>
        <version>1.0.1</version>
    </parent>

    <groupId>com.adobexp.loki</groupId>
    <artifactId>aem-loki-integrator</artifactId>
    <version>1.0.3</version>
    <packaging>pom</packaging>

    <name>AEM Loki Integrator - Reactor</name>
    <description>
        Bundles and content package that attach a Loki (loki4j) appender to the
        AEM (Sling Commons Log) Logback runtime. Every runtime setting - URL,
        credentials, labels, batching, logger levels - is driven by a single
        OSGi configuration.
    </description>

    <modules>
        <module>core</module>
        <module>loki4j</module>
        <module>all</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <java.version>11</java.version>

        <bnd.version>6.4.0</bnd.version>
        <aem.sdk.api>2023.3.11382.20230315T073850Z-230200</aem.sdk.api>
        <sling.commons.log.version>5.4.0</sling.commons.log.version>
        <loki4j.version>1.4.2</loki4j.version>

        <filevault.plugin.version>1.3.4</filevault.plugin.version>
        <bnd.plugin.version>${bnd.version}</bnd.plugin.version>
        <maven.compiler.plugin.version>3.11.0</maven.compiler.plugin.version>
        <maven.jar.plugin.version>3.3.0</maven.jar.plugin.version>
        <maven.enforcer.plugin.version>3.3.0</maven.enforcer.plugin.version>
        <aemanalyser.version>1.4.10</aemanalyser.version>

        <keyname>33C0330C91FCC3C1</keyname>
        <server>central</server>

        <!-- Override old plugin versions from central-maven-parent for better Git support -->
        <maven-release-plugin>3.0.1</maven-release-plugin>
        <maven-scm-plugin>2.0.1</maven-scm-plugin>
    </properties>

    <scm>
        <url>https://github.com/adobexp/aem-loki-integrator</url>
        <connection>scm:git:git@github.com:adobexp/aem-loki-integrator.git</connection>
        <developerConnection>scm:git:git@github.com:adobexp/aem-loki-integrator.git</developerConnection>
        <tag>aem-loki-integrator-1.0.3</tag>
    </scm>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven.compiler.plugin.version}</version>
                    <configuration>
                        <source>${java.version}</source>
                        <target>${java.version}</target>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven.jar.plugin.version}</version>
                    <configuration>
                        <archive>
                            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                        </archive>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>biz.aQute.bnd</groupId>
                    <artifactId>bnd-maven-plugin</artifactId>
                    <version>${bnd.plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.jackrabbit</groupId>
                    <artifactId>filevault-package-maven-plugin</artifactId>
                    <version>${filevault.plugin.version}</version>
                    <extensions>true</extensions>
                </plugin>

                <plugin>
                    <groupId>com.adobe.aem</groupId>
                    <artifactId>aemanalyser-maven-plugin</artifactId>
                    <version>${aemanalyser.version}</version>
                    <extensions>true</extensions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${maven.enforcer.plugin.version}</version>
                </plugin>
                <!-- Maven Resources Plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.0.2</version>
                </plugin>
                <!-- Maven Installer Plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>
                <!-- Maven Surefire Plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.1</version>
                    <configuration>
                        <useSystemClassLoader>false</useSystemClassLoader>
                    </configuration>
                </plugin>
                <!-- Maven Failsafe Plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>2.22.1</version>
                </plugin>
                <!-- Maven Deploy Plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <!-- Maven Release Plugin - using newer version for better Git support -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven-release-plugin}</version>
                <configuration>
                <autoVersionSubmodules>true</autoVersionSubmodules>
                <goals>deploy</goals>
                <!-- Pass performRelease=true to activate release-specific profiles (e.g., github-release) -->
                <releaseProfiles>github-release</releaseProfiles>
                <arguments>-DperformRelease=true</arguments>
                <!-- Ensure commits are pushed -->
                <pushChanges>true</pushChanges>
                <localCheckout>false</localCheckout>
                <!-- Use the project base directory for SCM operations -->
                <scmCommentPrefix>[maven-release-plugin] </scmCommentPrefix>
                <checkModificationExcludes>
                    <checkModificationExclude>${project.build.directory}</checkModificationExclude>
                    <checkModificationExclude>**/target</checkModificationExclude>
                </checkModificationExcludes>
                </configuration>
                <dependencies>
                <dependency>
                    <groupId>org.apache.maven.scm</groupId>
                    <artifactId>maven-scm-api</artifactId>
                    <version>${maven-scm-plugin}</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.maven.scm</groupId>
                    <artifactId>maven-scm-provider-gitexe</artifactId>
                    <version>${maven-scm-plugin}</version>
                </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>[3.6.0,)</version>
                                </requireMavenVersion>
                                <requireJavaVersion>
                                    <version>[11,)</version>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.adobe.aem</groupId>
                <artifactId>aem-sdk-api</artifactId>
                <version>${aem.sdk.api}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.sling</groupId>
                <artifactId>org.apache.sling.commons.log</artifactId>
                <version>${sling.commons.log.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>com.github.loki4j</groupId>
                <artifactId>loki-logback-appender</artifactId>
                <version>${loki4j.version}</version>
            </dependency>

            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>aem-loki-integrator.core</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>aem-loki-integrator.loki4j</artifactId>
                <version>${project.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
</project>
