You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "cziegeler (via GitHub)" <gi...@apache.org> on 2025/04/14 07:32:07 UTC
[PR] SLING-11906 : Provide 'all' bundle including logback and slf4j-api [sling-org-apache-sling-commons-log]
cziegeler opened a new pull request, #23:
URL: https://github.com/apache/sling-org-apache-sling-commons-log/pull/23
(no comment)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-11906 : Provide 'all' bundle including logback and slf4j-api [sling-org-apache-sling-commons-log]
Posted by "cziegeler (via GitHub)" <gi...@apache.org>.
cziegeler commented on code in PR #23:
URL: https://github.com/apache/sling-org-apache-sling-commons-log/pull/23#discussion_r2042493206
##########
pom.xml:
##########
@@ -285,6 +285,97 @@
<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>
+ <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)", \
Review Comment:
It does not compute them, the problem is that the dependency is missing and bnd has no knowledge about that version. Now adding the dependency to the pom would solve that issue, but then you need to keep the dependency in sync - which is the same.
Agree it is error prone, the only option I see right now is to add a big comment above
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-11906 : Provide 'all' bundle including logback and slf4j-api [sling-org-apache-sling-commons-log]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #23:
URL: https://github.com/apache/sling-org-apache-sling-commons-log/pull/23#issuecomment-2801048910
## [](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-commons-log&pullRequest=23) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-commons-log&pullRequest=23&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-commons-log&pullRequest=23&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-commons-log&pullRequest=23&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-commons-log&pullRequest=23&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-commons-log&pullRequest=23&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-commons-log&pullRequest=23)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-11906 : Provide 'all' bundle including logback and slf4j-api [sling-org-apache-sling-commons-log]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #23:
URL: https://github.com/apache/sling-org-apache-sling-commons-log/pull/23#issuecomment-2805039838
## [](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-commons-log&pullRequest=23) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-commons-log&pullRequest=23&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-commons-log&pullRequest=23&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-commons-log&pullRequest=23&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-commons-log&pullRequest=23&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-commons-log&pullRequest=23&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-commons-log&pullRequest=23)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-11906 : Provide 'all' bundle including logback and slf4j-api [sling-org-apache-sling-commons-log]
Posted by "jsedding (via GitHub)" <gi...@apache.org>.
jsedding commented on code in PR #23:
URL: https://github.com/apache/sling-org-apache-sling-commons-log/pull/23#discussion_r2042147909
##########
pom.xml:
##########
@@ -285,6 +285,97 @@
<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>
+ <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)", \
Review Comment:
Is it necessary to have explicit version numbers in the imports? I am concerned that this will be difficult and error prone to maintain. If bnd could determine these versions automatically, that would be preferable.
##########
pom.xml:
##########
@@ -285,6 +285,97 @@
<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>
+ <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", \
Review Comment:
Similar to above. Could bnd auto-generate/copy these version numbers?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-11906 : Provide 'all' bundle including logback and slf4j-api [sling-org-apache-sling-commons-log]
Posted by "cziegeler (via GitHub)" <gi...@apache.org>.
cziegeler commented on PR #23:
URL: https://github.com/apache/sling-org-apache-sling-commons-log/pull/23#issuecomment-2805003825
@rombert it seems I misread your comment :) I think we should embed the least amount of bundles required, which seems to be logback and slf4j api. The other bridges are optional and might not be needed depending on which other bundles you have installed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-11906 : Provide 'all' bundle including logback and slf4j-api [sling-org-apache-sling-commons-log]
Posted by "cziegeler (via GitHub)" <gi...@apache.org>.
cziegeler merged PR #23:
URL: https://github.com/apache/sling-org-apache-sling-commons-log/pull/23
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-11906 : Provide 'all' bundle including logback and slf4j-api [sling-org-apache-sling-commons-log]
Posted by "cziegeler (via GitHub)" <gi...@apache.org>.
cziegeler commented on code in PR #23:
URL: https://github.com/apache/sling-org-apache-sling-commons-log/pull/23#discussion_r2042494181
##########
pom.xml:
##########
@@ -285,6 +285,97 @@
<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>
+ <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", \
Review Comment:
Those are static and will never change. bnd correctly generates the right export versions for 2.x - but these two packages need also be exported with the latest 1.x release for compatibility.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-11906 : Provide 'all' bundle including logback and slf4j-api [sling-org-apache-sling-commons-log]
Posted by "cziegeler (via GitHub)" <gi...@apache.org>.
cziegeler commented on PR #23:
URL: https://github.com/apache/sling-org-apache-sling-commons-log/pull/23#issuecomment-2802271870
@rombert The "all" bundle includes slf4j-api, so yes, that needs to be removed. Are other changes required to make the starter work?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-11906 : Provide 'all' bundle including logback and slf4j-api [sling-org-apache-sling-commons-log]
Posted by "rombert (via GitHub)" <gi...@apache.org>.
rombert commented on PR #23:
URL: https://github.com/apache/sling-org-apache-sling-commons-log/pull/23#issuecomment-2801474436
Oh, those packages are re-imported, so no issue here. Trying to integrate this in the Starter I see that various bundles would fail to resolve if I remove all traces of slf4j because of the missing 'bridges'
```
[ERROR] [bundle-packages] org.apache.pdfbox:pdfbox:2.0.33: Bundle is importing package org.apache.commons.logging with start order 10 but no bundle is exporting these for that start order.
[ERROR] [bundle-packages] org.apache.httpcomponents:httpclient-osgi:4.5.14: Bundle is importing package org.apache.commons.logging with start order 15 but no bundle is exporting these for that start order.
[ERROR] [bundle-packages] org.apache.pdfbox:fontbox:2.0.33: Bundle is importing package org.apache.commons.logging with start order 10 but no bundle is exporting these for that start order.
[ERROR] [bundle-packages] org.apache.sling:org.apache.sling.xss:2.4.6: Bundle is importing packages [org.apache.commons.logging, org.apache.log4j] with start order 20 but no bundle is exporting these for that start order.
```
Of course, we can add back required bundles to the starter
- `org.slf4j:jcl-over-slf4j:${slf4j.version}`
- `org.slf4j:log4j-over-slf4j:${slf4j.version`
But then we'd end up in a situation where we partially embed and partially deploy slf4j. Should we instead embed all needed slf4j jars in the commons.log bundle?
(and BTW when running the Starter ITs all the logging output goes to the console, but that's something for later)
```patch
diff --git a/src/main/features/boot.json b/src/main/features/boot.json
index ce0d02e..bcc4584 100644
--- a/src/main/features/boot.json
+++ b/src/main/features/boot.json
@@ -69,7 +69,7 @@
"start-order":"1"
},
{
- "id":"org.apache.sling:org.apache.sling.commons.log:5.5.0",
+ "id":"org.apache.sling:org.apache.sling.commons.log:jar:all:6.0.0-SNAPSHOT",
"start-order":"1"
},
{
@@ -152,10 +152,6 @@
"id":"org.slf4j:log4j-over-slf4j:${slf4j.version}",
"start-order":"1"
},
- {
- "id":"org.slf4j:slf4j-api:${slf4j.version}",
- "start-order":"1"
- },
{
"id":"org.apache.felix:org.apache.felix.scr:2.2.12",
"start-order":"1"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org