Hi Felix,

Thank you for answering so quickly!

Okay I am not sure I understand everything but it seems you are right about
JDOM causing strange imports.
What do you mean by saying "If you don't want to embed libraries"? When a
bundle uses some libs is there an other way than embedding either the jar or
the .class into the bundle?

Yersterday I finally managed to make things work by adding every JDOM
components as a dependency in the Maven project (see below).
And also by configuring the maven plugin like this:


<Export-Package>fr.numvision.*,org.apache.*,com.jcraft.*,org.jdom,org.jdom.*,org.snipecode.*,org.jaxen,org.jaxen.*</Export-Package>
> <Private-Package></Private-Package>
> <Import-Package>*;resolution:=optional</Import-Package>
>


Doing this, the Import-Package still have all the javax.* in it but doesn't
try to resolve it.
I think this solution is quite "dirty". Also I don't like the way I have to
tell the plugin what Maven already nows (the list of the dependencies...).


To resume, I would like to be able to say "1)Hello Maven, this is my
Project. 2)Hello Bundle-Plugin, just embed everything you need into the
bundle, and make the main package fr.numvision.* available for another
bundle".
So for me the plugin part should looks like that:



> <Export-Package>fr.numvision.*</Export-Package>
> <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
>


What does "inlining" means (sorry I am really new to this...)?
I am currently reading the OSGI reference at
http://www.osgi.org/download/r4v42/r4.core.pdf (but it is quite a work for
"just" building a bundle!)

Thanks for your help!


*The dependencies part of my POM:*

<dependency>
            <groupId>org.jdom</groupId>
            <artifactId>jdom</artifactId>
            <version>1.1</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.jdom</groupId>
            <artifactId>jaxen-core</artifactId>
            <version>1.0-FCS</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.jdom</groupId>
            <artifactId>jaxen-jdom</artifactId>
            <version>1.0-FCS</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.jdom</groupId>
            <artifactId>saxpath</artifactId>
            <version>1.0-FCS</version>
            <scope>compile</scope>
        </dependency>




2010/1/13 Felix Meschberger <[email protected]>

> Hi,
>
> This sounds like a problem of stuff in the root package of one of the
> libraries -- JDOM is known for having 3 (IIRC) classes in the root
> package posing all sorts of problems because the root package cannot be
> imported (and the root package should not be used anyways).
>
> So the only solution, I see here is to prevent this problem is embedded
> JDOM as a library as in:
>
>   <Embed-Dependencies>
>      jdom
>   </Embed-Dependencies>
>
> If you don't want to embed libraries, I suggest you control inlining by
> limiting it to the org.jdom package, as in:
>
>   <Embed-Dependencies>
>      jdom;inline=org/jdom/**
>   </Embed-Dependencies>
>
> Hope this helps.
>
> Regards
> Felix
>
>
>

Reply via email to