[ 
https://issues.apache.org/jira/browse/LOGGING-190?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17829773#comment-17829773
 ] 

Hannes Wellmann commented on LOGGING-190:
-----------------------------------------

The Manifest is created using the {{{}maven-bundle-plugin{}}}, but it is 
defined in the parent pom and only the property {{commons.osgi.import}} is 
adjusted in this project's {{{}pom.xml{}}}. You can see that in Eclipse when 
selecting the {{Effecitve POM}} tab in the POM-Editor.

> Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"

This is created automatically by the maven-bundle-plugin (which by the way uses 
BND under the hood), derived from the compiler settings respectively from the 
class-file version encountered in the compiled classes.

I just created [https://github.com/apache/commons-logging/pull/234] to address 
that, with small adjustments.
[[email protected]] please have a look and test.

> ServiceLoader with OSGi improvements (so commons can be used in an OSGi 
> environment)
> ------------------------------------------------------------------------------------
>
>                 Key: LOGGING-190
>                 URL: https://issues.apache.org/jira/browse/LOGGING-190
>             Project: Commons Logging
>          Issue Type: Improvement
>    Affects Versions: 1.3.0
>            Reporter: Johan Compagner
>            Priority: Major
>
> Log4j JCL bridge already has the correct osgi stuff in the manifest to create 
> the bridge in an OSGi environment for example Eclipse
>  
> But commons logging does mis a bit, it only has:
> Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"
>  
> but that should be:
>  
> Require-Capability: osgi.extender;filter:="(&(osgi.extender=osgi.service
>  loader.processor)(version>=1.0.0)(!(version>=2.0.0)))",osgi.serviceload
>  er;filter:="(osgi.serviceloader=org.apache.commons.logging.LogFactory)";os
>  gi.serviceloader="org.apache.commons.logging.LogFactory",osgi.ee;filter:="
>  (&(osgi.ee=JavaSE)(version=1.8))"
>  
> so that it hooks up with for example what is specified in the jcl bindings of 
> log4j-jcl which defines this:
>  
> Provide-Capability: osgi.service;objectClass:List<String>="org.apache.co
>  mmons.logging.LogFactory";effective:=active,osgi.serviceloader;osgi.ser
>  viceloader="org.apache.commons.logging.LogFactory";register:="org.apach
>  e.logging.log4j.jcl.LogFactoryImpl"
> Require-Capability: osgi.extender;filter:="(&(osgi.extender=osgi.service
>  loader.registrar)(version>=1.0.0)(!(version>=2.0.0)))";resolution:=opti
>  onal,osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"
>  
> So could the thing above be added to the build so it has the correct osgi 
> registration stuff?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to