incubator-clerezza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reto Bachmann-Gmuer <reto.bachm...@trialox.org>
Subject Re: Jena as OSGi bundle?
Date Wed, 17 Nov 2010 14:31:47 GMT
On Tue, Nov 16, 2010 at 10:33 PM, Paolo Castagna
<castagna.lists@googlemail.com> wrot
>
> Perhaps, it's just me not fully understand what <packaging>bundle</packaging>
> actually does and what are the consequences for people not using OSGi if we
> change from "jar" to "bundle". I guess the answer is: none. But, a confirmation
> on this would be good.
with the bundle packaging the jar is created by the
maven-bundle-plugin which should be identical to the one created with
packaging jar except for the additional infos in META-INF/MANIFEST.MF
>
>> I think it should be possible to associate the bundle (or bundleall)
>> goal of the maven-bundle-plugin to the defaukt packaging phase, but I
>> think its easier to use packaging "bundle".
>
> I will try to see how it goes and if there are other plug-ins which might
> be influenced by the jar --> bundle change.
>
>> Another thing to consider is if some depenendencies have to be
>> included in the jar, the current clerezza bundle contains most
>> dependencies as we didn't find them as bundles, however having the
>> dependencies in the jar is not useful outside the context of osgi (I
>> think). It might worth considering having a jena jar without
>> dependencies and one with. The first could only use in a container
>> where all required packages are exported by other bundles.
>
> Ok, so this is an important difference to consider.
>
> We would need to have two jars.
It would be nice to have every jena jar to be an OSGI bundle (just by
having a couple of more lines in the manifest. Additionally it would
be useful to have one or both of the following:
- all-in-one bundles for jena and tdb
- a bundle version for every dependencies (possibly grouping several
dependencies together)
>
> Could your or someone from clerezza help me to see how we might do this?
We did the bundling in a quite minimalistic way, for instance we don't
expose version numbers for packages (and this already caused some late
detected compatibility issues), but I'm happy to contribute my limited
knowledge.

> Would you do it via the assembly.xml file?
No, the maven-bundle-plugin can include dependencies either as jars or
by expanding their contents. Afaik, the assembly plugin is needed only
if you want to make an archive that is expanded by the user before
running the application, not for adding additional stuff to the jar.

> Do you have an example of pom.xml|assembly.xml file doing this
> "double" packaging, one for OSGi and one 'usual' jar?
create two artifacts with the same pom could be done by using
profiles, but I'd not recommend this approach but rather to have
multiple poms (like a parent and two children for the two artifacts
jena and jena-all-in-one).

Ciao,
Reto
>
> Cheers,
> Paolo
>
>> Cheers,
>> Reto
>>
>> On Mon, Nov 15, 2010 at 8:27 PM, Paolo Castagna
>> <castagna.lists@googlemail.com> wrote:
>>> Hi,
>>> sorry for the 'intrusion', I have one question about OSGi and Jena.
>>>
>>> I saw you have a pom.xml [1] to group all the Jena artifacts and
>>> dependencies in a OSGi bundle.
>>>
>>> While ago I tried to provide support for people wanting to use Jena as
>>> a OSGi bundle (however, I am not an OSGi expert myself and I am not
>>> sure that was enough).
>>>
>>> Is there something we can do in Jena to provide you with a jar which
>>> gets you everything you need in relation to Clerezza and the OSGi
>>> framework?
>>>
>>> In particular, would having this in the Jena pom.xml help you?
>>>
>>> <plugin>
>>>  <groupId>org.apache.felix</groupId>
>>>  <artifactId>maven-bundle-plugin</artifactId>
>>>  <extensions>true</extensions>
>>>  <configuration>
>>>    <instructions>
>>>      <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
>>>      <Embed-Dependency>*;artifactId=!commons-logging</Embed-Dependency>
>>>      <Embed-Transitive>true</Embed-Transitive>
>>>      <Import-Package>!com.hp.hpl.jena.*.test,
>>>            !org.apache.xml.resolver.*,!sun.*,
>>>            !com.sun.msv.*,
>>>            !com.sun.jdmk.*,
>>>            !javax.jms.*,
>>>            !org.relaxng.*,
>>>            *</Import-Package>
>>>      <Export-Package>com.hp.hpl.jena.*,
>>>            org.apache.xerces.util</Export-Package>
>>>    </instructions>
>>>  </configuration>
>>> </plugin>
>>>
>>> And, would it work with <packaging>jar</packaging>?
>>>
>>> Ditto for TDB [3].
>>>
>>> Thank you in advance for your help.
>>>
>>> Paolo
>>>
>>>  [1]
>>> http://svn.apache.org/repos/asf/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.ext.com.hp.hpl.jena/pom.xml
>>>  [2] http://jena.cvs.sourceforge.net/viewvc/jena/jena2/pom.xml?view=markup
>>>  [3]
>>> http://svn.apache.org/repos/asf/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.ext.com.hp.hpl.jena.tdb/pom.xml
>>>
>>
>

Mime
View raw message