<?xml version="1.0" encoding="UTF-8"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF 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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.apache.sling</groupId>
        <artifactId>sling-bundle-parent</artifactId>
        <version>65</version>
        <relativePath />
    </parent>

    <artifactId>org.apache.sling.commons.log</artifactId>
    <version>6.0.4</version>

    <name>Apache Sling Commons Log</name>
    <description>This bundle provides a logging implementation based on Logback.</description>

    <scm>
        <connection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-log.git</connection>
        <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-log.git</developerConnection>
        <tag>org.apache.sling.commons.log-6.0.4</tag>
        <url>https://github.com/apache/sling-org-apache-sling-commons-log.git</url>
    </scm>

    <properties>
        <logback.version>1.5.32</logback.version>
        <!-- Higher versions of pax exam cause class loading errors -->
        <org.ops4j.pax.exam.version>4.13.3</org.ops4j.pax.exam.version>
        <project.build.outputTimestamp>1771883977</project.build.outputTimestamp>
        <sling.java.version>11</sling.java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.framework</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.annotation.versioning</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.cm</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.component.annotations</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.event</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.util.converter</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.resource</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.util.tracker</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jul-to-slf4j</artifactId>
            <version>${slf4j.version}</version>
            <scope>compile</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>log4j-over-slf4j</artifactId>
            <version>${slf4j.version}</version>
            <scope>compile</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>${slf4j.version}</version>
            <scope>compile</scope>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
            <version>${logback.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>5.11.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>
        <!--JUnit Jupiter Engine to depend on the JUnit4 engine and JUnit 4 API  -->
        <dependency>
            <groupId>org.junit.vintage</groupId>
            <artifactId>junit-vintage-engine</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.testing.osgi-mock.core</artifactId>
            <version>3.4.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.testing.osgi-mock.junit5</artifactId>
            <version>3.4.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
            <version>4.2.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.framework</artifactId>
            <version>7.0.5</version>
            <scope>test</scope>
        </dependency>

        <!-- Pax Exam -->
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam</artifactId>
            <version>${org.ops4j.pax.exam.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-cm</artifactId>
            <version>${org.ops4j.pax.exam.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-container-forked</artifactId>
            <version>${org.ops4j.pax.exam.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-junit4</artifactId>
            <version>${org.ops4j.pax.exam.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-link-mvn</artifactId>
            <version>${org.ops4j.pax.exam.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.tinybundles</groupId>
            <artifactId>tinybundles</artifactId>
            <version>3.0.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.log</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.configadmin</artifactId>
            <version>1.9.26</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.eventadmin</artifactId>
            <version>1.4.8</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.util.function</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.util.pushstream</artifactId>
            <version>1.1.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.util.promise</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.http.servlet-api</artifactId>
            <version>2.1.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>biz.aQute.bnd</groupId>
                <artifactId>bnd-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>bnd-process</id>
                        <configuration>
                            <bnd><![CDATA[
Bundle-Name: ${project.name}
Bundle-SymbolicName: ${project.artifactId}
Bundle-DocURL: http://sling.apache.org/site/logging.html
Bundle-Activator: org.apache.sling.commons.log.logback.internal.Activator
Import-Package: org.osgi.service.cm;version="[1.2,2)";resolution:=dynamic, \
    org.osgi.service.event;version="[1.2,2)";resolution:=dynamic, \
    javax.xml.transform.*;resolution:=dynamic, \
    org.slf4j.bridge;resolution:=optional, \
    *
Require-Capability: osgi.extender;filter:="(&(osgi.extender=osgi.serviceloader.registrar)(version>=1.0.0)(!(version>=2.0.0)))"
Provide-Capability: osgi.serviceloader;osgi.serviceloader="ch.qos.logback.classic.spi.Configurator"
]]></bnd>
                            <manifestPath>${project.build.directory}/nodeps-classes/META-INF/MANIFEST.MF</manifestPath>
                            <outputDir>${project.build.directory}/nodeps-classes</outputDir>
                        </configuration>
                    </execution>
                    <execution>
                        <id>bnd-process-deps</id>
                        <goals>
                            <goal>bnd-process</goal>
                        </goals>
                        <configuration>
                            <!--
  NOTE: If you update the dependencies embedded belowe (logback core and classic and slf4j-api),
  please also update the version ranges in the package imports and make sure to correctly list
  all optional imports. These might change in between versions.
-->
                            <bnd><![CDATA[
Bundle-Name: ${project.name} (Including dependencies)
Bundle-SymbolicName: ${project.artifactId}.all
Bundle-Description: §{project.description} It embeds logback core, classic and slf4j-api.
Bundle-DocURL: http://sling.apache.org/site/logging.html
Bundle-Activator: org.apache.sling.commons.log.logback.internal.embed.EmbeddedBundleActivator
-includeresource:@logback-core-[0-9.]*(-SNAPSHOT)?.jar, \
    @logback-classic-[0-9.]*(-SNAPSHOT)?.jar, \
    @slf4j-api-[0-9.]*(-SNAPSHOT)?.jar
Import-Package: org.osgi.service.cm;version="[1.2,2)";resolution:=dynamic, \
    org.osgi.service.event;version="[1.2,2)";resolution:=dynamic, \
    javax.xml.transform.*;resolution:=dynamic, \
    org.slf4j.bridge;resolution:=optional, \
    jakarta.mail;resolution:=optional, \
    jakarta.mail.internet;resolution:=optional, \
    jakarta.servlet;resolution:=optional, \
    jakarta.servlet.http;resolution:=optional, \
    org.codehaus.commons.compiler;resolution:=optional;version="[3.1,4)", \
    org.codehaus.janino;resolution:=optional;version="[3.1,4)", \
    org.fusesource.jansi;resolution:=optional;version="[2.4,3)", \
    org.tukaani.xz;resolution:=optional, \
    *
Export-Package: ch.qos.logback.classic.*, \
    ch.qos.logback.core.*, \
    org.slf4j.*, \
    org.slf4j;version="1.7.36", \
    org.slf4j.helpers;version="1.7.36", \
    ${removeall;${packages;VERSIONED};${packages;CONDITIONAL}}
]]></bnd>
                            <manifestPath>${project.build.directory}/deps-classes/META-INF/MANIFEST.MF</manifestPath>
                            <outputDir>${project.build.directory}/deps-classes</outputDir>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-jar</id>
                        <configuration>
                            <classesDirectory>${project.build.directory}/nodeps-classes</classesDirectory>
                            <archive>
                                <manifestFile>${project.build.directory}/nodeps-classes/META-INF/MANIFEST.MF</manifestFile>
                            </archive>
                        </configuration>
                    </execution>
                    <execution>
                        <id>jar-deps</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <classifier>all</classifier>
                            <classesDirectory>${project.build.directory}/deps-classes</classesDirectory>
                            <archive>
                                <manifestFile>${project.build.directory}/deps-classes/META-INF/MANIFEST.MF</manifestFile>
                            </archive>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <configuration>
                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
                    <systemPropertyVariables>
                        <bundle.filename>${basedir}/target/${project.build.finalName}.jar</bundle.filename>
                    </systemPropertyVariables>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.servicemix.tooling</groupId>
                <artifactId>depends-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>
