You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Arash Amiri <ar...@researchstudio.at> on 2007/08/24 18:28:06 UTC

bundle plugin misses its own dependencies

Hi,
um...
sometimes (I say "sometimes" because I really dont know what the cause 
is), a bundle, that I create with the maven-bundle-plugin, misses, once 
deployed, its own packages.

e.g. I have a package "org.myapp.meta" in my maven project.
I configure the maven bundle plugin (in the same project) the following way:
...
<Import-Package>org.myapp.*;resolution:=optional</Import-Package>
<Export-Package>org.myapp.*</Export-Package>
...

when I deploy it in equinox, it gives me an error such as:
Missing imported package org.myapp.meta
I dont get this, since the jar file contains the package.

Yet, I have to admit that the bundle has other dependencies which are 
not (yet) satifsfied.
e.g. the org.myapp.meta package uses "org.openrdf.elmo" which is in a 
bundle not yet deployed (since I have to create it first).

my question:
Is it a maven bundle plugin configuration issue or is it simply Equinox 
that refuses to import packages which have unresolved references?

greetings,
arash

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: bundle plugin misses its own dependencies

Posted by Stuart McCulloch <st...@jayway.net>.
On 25/08/07, Richard S. Hall <he...@ungoverned.org> wrote:
>
> Arash Amiri wrote:
> > Hi,
> > um...
> > sometimes (I say "sometimes" because I really dont know what the cause
> > is), a bundle, that I create with the maven-bundle-plugin, misses,
> > once deployed, its own packages.
> >
> > e.g. I have a package "org.myapp.meta" in my maven project.
> > I configure the maven bundle plugin (in the same project) the
> > following way:
> > ...
> > <Import-Package>org.myapp.*;resolution:=optional</Import-Package>
> > <Export-Package>org.myapp.*</Export-Package>
> > ...
> >
> > when I deploy it in equinox, it gives me an error such as:
> > Missing imported package org.myapp.meta
> > I dont get this, since the jar file contains the package.
> >
> > Yet, I have to admit that the bundle has other dependencies which are
> > not (yet) satifsfied.
> > e.g. the org.myapp.meta package uses "org.openrdf.elmo" which is in a
> > bundle not yet deployed (since I have to create it first).


if the 'org.myapp.meta' package depends on a non-deployed package
then this could explain the equinox error (although it could be clearer!)

if you still see the error with 'org.openrdf.elmo' deployed then please
provide a testcase (or at least the poms + manifests + diag output).

>
> > my question:
> > Is it a maven bundle plugin configuration issue or is it simply
> > Equinox that refuses to import packages which have unresolved
> references?
>
> Just a guess, since I don't really know how Equinox' resolver works, but
> it could be that it is trying to resolve the bundle to its own export
> since you import/export the same package, but it is unable to do so
> because it cannot resolve the bundle itself, so the error message says
> it cannot find the package because it cannot resolve the provider of the
> package, which just happens to be the same bundle in this case. This
> could potentially happen, depending on how Equinox handles bundles
> importing their own packages.
>
> One question for you, why are you importing the same packages you are
> exporting with an "optional" directive. Seems kind of strange and it
> might be meaningless since the bundle will always have access to the
> package since it exports them.
>
> Also, shouldn't this be on the Felix users mailing list?
>
> -> richard
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Cheers, Stuart

Re: bundle plugin misses its own dependencies

Posted by Arash Amiri <ar...@researchstudio.at>.
Richard S. Hall schrieb:
> Arash Amiri wrote:
>> Hi,
>> um...
>> sometimes (I say "sometimes" because I really dont know what the 
>> cause is), a bundle, that I create with the maven-bundle-plugin, 
>> misses, once deployed, its own packages.
>>
>> e.g. I have a package "org.myapp.meta" in my maven project.
>> I configure the maven bundle plugin (in the same project) the 
>> following way:
>> ...
>> <Import-Package>org.myapp.*;resolution:=optional</Import-Package>
>> <Export-Package>org.myapp.*</Export-Package>
>> ...
>>
>> when I deploy it in equinox, it gives me an error such as:
>> Missing imported package org.myapp.meta
>> I dont get this, since the jar file contains the package.
>>
>> Yet, I have to admit that the bundle has other dependencies which are 
>> not (yet) satifsfied.
>> e.g. the org.myapp.meta package uses "org.openrdf.elmo" which is in a 
>> bundle not yet deployed (since I have to create it first).
>>
>> my question:
>> Is it a maven bundle plugin configuration issue or is it simply 
>> Equinox that refuses to import packages which have unresolved 
>> references?
>
> Just a guess, since I don't really know how Equinox' resolver works, 
> but it could be that it is trying to resolve the bundle to its own 
> export since you import/export the same package, but it is unable to 
> do so because it cannot resolve the bundle itself, so the error 
> message says it cannot find the package because it cannot resolve the 
> provider of the package, which just happens to be the same bundle in 
> this case. This could potentially happen, depending on how Equinox 
> handles bundles importing their own packages.
>
> One question for you, why are you importing the same packages you are 
> exporting with an "optional" directive. Seems kind of strange and it 
> might be meaningless since the bundle will always have access to the 
> package since it exports them.
>
> Also, shouldn't this be on the Felix users mailing list?
>
thanks for the quick reply. I never know where to post 
maven-bundle-plugin issues, since I see lots of them being posted to 
this list as well.
Anyway, I hope that creating the other bundles solves my problem and 
that equinox is simply not resolving those bundles.

cheers,
arash
> -> richard
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: bundle plugin misses its own dependencies

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Arash Amiri wrote:
> Hi,
> um...
> sometimes (I say "sometimes" because I really dont know what the cause 
> is), a bundle, that I create with the maven-bundle-plugin, misses, 
> once deployed, its own packages.
>
> e.g. I have a package "org.myapp.meta" in my maven project.
> I configure the maven bundle plugin (in the same project) the 
> following way:
> ...
> <Import-Package>org.myapp.*;resolution:=optional</Import-Package>
> <Export-Package>org.myapp.*</Export-Package>
> ...
>
> when I deploy it in equinox, it gives me an error such as:
> Missing imported package org.myapp.meta
> I dont get this, since the jar file contains the package.
>
> Yet, I have to admit that the bundle has other dependencies which are 
> not (yet) satifsfied.
> e.g. the org.myapp.meta package uses "org.openrdf.elmo" which is in a 
> bundle not yet deployed (since I have to create it first).
>
> my question:
> Is it a maven bundle plugin configuration issue or is it simply 
> Equinox that refuses to import packages which have unresolved references?

Just a guess, since I don't really know how Equinox' resolver works, but 
it could be that it is trying to resolve the bundle to its own export 
since you import/export the same package, but it is unable to do so 
because it cannot resolve the bundle itself, so the error message says 
it cannot find the package because it cannot resolve the provider of the 
package, which just happens to be the same bundle in this case. This 
could potentially happen, depending on how Equinox handles bundles 
importing their own packages.

One question for you, why are you importing the same packages you are 
exporting with an "optional" directive. Seems kind of strange and it 
might be meaningless since the bundle will always have access to the 
package since it exports them.

Also, shouldn't this be on the Felix users mailing list?

-> richard

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: bundle plugin misses its own dependencies

Posted by Tim Kettler <ti...@udo.edu>.
Hi,

the maven-bundle-plugin's job is to package the bundle and create the 
bundle manifest. So if all packages/classes you expect are included in 
the bundle jar and the manifest content matches what you configured in 
the plugin configuration the plugin has done it's job.

If you have a specific osgi related question about the correct manifest 
content for your use-case or the behaviour of an osgi implementation you 
might have more luck to get this answered on a more osgi related 
mailinglist (like that of the implementation you are using).

-Tim

Arash Amiri schrieb:
> Hi,
> um...
> sometimes (I say "sometimes" because I really dont know what the cause 
> is), a bundle, that I create with the maven-bundle-plugin, misses, once 
> deployed, its own packages.
> 
> e.g. I have a package "org.myapp.meta" in my maven project.
> I configure the maven bundle plugin (in the same project) the following 
> way:
> ...
> <Import-Package>org.myapp.*;resolution:=optional</Import-Package>
> <Export-Package>org.myapp.*</Export-Package>
> ...
> 
> when I deploy it in equinox, it gives me an error such as:
> Missing imported package org.myapp.meta
> I dont get this, since the jar file contains the package.
> 
> Yet, I have to admit that the bundle has other dependencies which are 
> not (yet) satifsfied.
> e.g. the org.myapp.meta package uses "org.openrdf.elmo" which is in a 
> bundle not yet deployed (since I have to create it first).
> 
> my question:
> Is it a maven bundle plugin configuration issue or is it simply Equinox 
> that refuses to import packages which have unresolved references?
> 
> greetings,
> arash
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org