Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-dev] maven-bundle-plugin based OSGi bundle fails to export package contents correctly if the same package is located in multiple dependencies

Hello,

I have setup:

Eclipse Juno with PDE:
Version: 3.8.0.v20120525-1249-7c7vFitFFt6Zr5a12MM4IKMFZ
Build id: I20120608-1400

m2e plugin:
Version: 1.1.0.20120530-0009

maven-bundle-plugin:
Version: 2.3.7


I use OSGi wrapping bundles (maven-bundle-plugin generates manifest and uses Maven container for dependencies resolution). They wrap projects which are also under development on the same workspace.
I have 2 projects with the same package.
For instance:
Project A has package:
a.b.c
Project B has packages:
a.b.c
a.b.d

Project B produces 2 artifacts. One of them contains everything (Artifact B1) and another one contains only a.b.c package contents (Artifact B2).

Moving a.b.c package from Project B "is not possible". Because it will introduce cycle in dependencies. Package rename is also prohibited, because of compatibility issues.
One solution could be - move Project A contents inside Project B, but it is also not an option because Project B will be too heavy.

I have 2 wrappers for both projects:
Wrapper A' which has dependencies to project A and B (Artifact B2). It exports a.b.c package.
Wrapper B' has dependency to project B and it exports a.b.d package.

Now, if I do not have Project B on my workspace then wrappers resolve artifacts(Artifact B2 + Project A artifact for A' wrapper bundle, Artifact B1 for B' wrapper bundle) from maven local repository and everything works fine.
But if I have this Project B on my workspace and Maven container of wrapper bundle resolves it like a reference to the project then I get compilation errors (Access restriction) in bundles which are using this wrapper(by importing package or specifying wrapper bundle as required). It seems like wrapper bundles export package partially, what seems to be unexpected.
Also tried to specify access rules on Maven container - doesn't work at all.


Am I doing something wrong here? Or can you suggest something?


Br,
Alexander

Back to the top