You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2025/04/15 13:28:13 UTC

(sling-org-apache-sling-commons-log) branch master updated: SLING-11906 : Provide 'all' bundle including logback and slf4j-api (#23)

This is an automated email from the ASF dual-hosted git repository.

cziegeler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-log.git


The following commit(s) were added to refs/heads/master by this push:
     new 71c229d  SLING-11906 : Provide 'all' bundle including logback and slf4j-api (#23)
71c229d is described below

commit 71c229d593a8ad1e5ac2ef79d8d25377e7800105
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Apr 15 15:28:07 2025 +0200

    SLING-11906 : Provide 'all' bundle including logback and slf4j-api (#23)
    
    * SLING-11906 : Provide 'all' bundle including logback and slf4j-api
    
    * Ignore vscode files
    
    * Add note about carefully checking imports
    
    ---------
    
    Co-authored-by: Robert Munteanu <ro...@apache.org>
---
 .gitignore |  1 +
 bnd.bnd    |  9 ------
 pom.xml    | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 97 insertions(+), 9 deletions(-)

diff --git a/.gitignore b/.gitignore
index 5b783ed..9804514 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@
 .project
 .settings
 .externalToolBuilders
+.vscode
 maven-eclipse.xml
 *.swp
 *.iml
diff --git a/bnd.bnd b/bnd.bnd
deleted file mode 100644
index 621e3a6..0000000
--- a/bnd.bnd
+++ /dev/null
@@ -1,9 +0,0 @@
-Bundle-DocURL: http://sling.apache.org/site/logging.html
-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"
diff --git a/pom.xml b/pom.xml
index a4f7421..c7bf362 100644
--- a/pom.xml
+++ b/pom.xml
@@ -285,6 +285,102 @@
 
     <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
+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-DocURL: http://sling.apache.org/site/logging.html
+-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.apache.commons.lang3;resolution:=optional;version="[3.0,4)", \
+    *
+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>