You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by LongkerDandy <lo...@gmail.com> on 2011/01/04 14:39:23 UTC
Bundle dependency with tools.jar and how to mark a import package as optional
Hi
I'm trying to convert a library to OSGi.
I faced two problem:
1. The bundle I created has import lots of package from tools.jar (like
com.sun.javadoc or com.sun.javac).
They're not been exposed by default, what is the best way to deal with
it.
2. The library target both Java and Android platform. Thus it has a
dependency to "android.app".
I think I can mark all the android related package as optional, but I
don't know how to do it with maven bundle plugin.
Regards
LongkerDandy
Re: Bundle dependency with tools.jar and how to mark a import package
as optional
Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 1/5/11 3:57, LongkerDandy wrote:
> Just want to post back.
>
> Mark a package as optional is easy, just need add:
> <Import-Package>android.*;resolution:=optional, *</Import-Package>
>
> But I still don't find a good way to deal with tools.jar.
> It shipped with JDK not JRE, thus export is in system.package seems a bad
> idea.
I'm not sure what kind of solution you are looking for. There isn't much
you can do, your bundle must import them if it uses them and someone
must export them. There isn't a way around that. If your concern is that
they might not be there if the user is running the JRE, then this is
true, but still not much more you can do.
-> richard
> On Tue, Jan 4, 2011 at 9:39 PM, LongkerDandy<lo...@gmail.com> wrote:
>
>> Hi
>> I'm trying to convert a library to OSGi.
>> I faced two problem:
>>
>> 1. The bundle I created has import lots of package from tools.jar (like
>> com.sun.javadoc or com.sun.javac).
>> They're not been exposed by default, what is the best way to deal with
>> it.
>>
>> 2. The library target both Java and Android platform. Thus it has a
>> dependency to "android.app".
>> I think I can mark all the android related package as optional, but I
>> don't know how to do it with maven bundle plugin.
>>
>> Regards
>> LongkerDandy
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: Bundle dependency with tools.jar and how to mark a import package
as optional
Posted by LongkerDandy <lo...@gmail.com>.
Just want to post back.
Mark a package as optional is easy, just need add:
<Import-Package>android.*;resolution:=optional, *</Import-Package>
But I still don't find a good way to deal with tools.jar.
It shipped with JDK not JRE, thus export is in system.package seems a bad
idea.
On Tue, Jan 4, 2011 at 9:39 PM, LongkerDandy <lo...@gmail.com> wrote:
> Hi
> I'm trying to convert a library to OSGi.
> I faced two problem:
>
> 1. The bundle I created has import lots of package from tools.jar (like
> com.sun.javadoc or com.sun.javac).
> They're not been exposed by default, what is the best way to deal with
> it.
>
> 2. The library target both Java and Android platform. Thus it has a
> dependency to "android.app".
> I think I can mark all the android related package as optional, but I
> don't know how to do it with maven bundle plugin.
>
> Regards
> LongkerDandy
>