On 7/21/10 13:02, Sudhir Dharmadhikari wrote:
Hi Richard,
Thanks for reply. I understand system bundle is redundant.

It isn't redundant, it is actually bad practice. The OSGi spec doesn't dictate what the system bundle exports, so framework implementations can vary here. And even if the spec defined a default value, most impls allow this to be configured, so you still couldn't be sure what you were getting from the system bundle.

Requiring the system bundle simply hides the real dependencies of your bundle so frameworks cannot know if they are actually satisfying them or not.

-> richard

With following setup, I am getting Export-Package which are all my application code. I got rid of that because I was getting several errors. But may be that is not necessary (export should not have any issues whether its being used by any other bundle or not) .
Thanks.

Richard S. Hall wrote:

On 7/20/10 5:13 PM, Sudhir Dharmadhikari wrote:
Hi Richard - Thanks for your inputs. It worked using !*. As per documentation, it should export all classes and it is. Right now, no other bundle will use any exported packages from my bundle , so I wanted to get rid of this header at all from manifest . Similarly, there are hundreds of entries in Import-Package but none of them is needed . So I am disabling it as you suggested. That worked, but it created new header Ignore-Package and ignored all the one which were getting included. Just in case you wanted to see my configuration..

Here is my code,
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<version>2.1.0</version>
<configuration> <instructions> <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
<Bundle-ClassPath>{maven-dependencies},.</Bundle-ClassPath>
<Embed-Transitive>true</Embed-Transitive>
<Bundle-RequiredExecutionEnvironment>JavaSE-1.6</Bundle-RequiredExecutionEnvironment>
<Bundle-Activator>osgi.Activator</Bundle-Activator>
<Require-Bundle>org.eclipse.osgi;bundle-version="3.5.2"</Require-Bundle>
<Import-Package>!*</Import-Package>
<Export-Package>!*</Export-Package>

It doesn't seem like this should be necessary for Export-Package, since the default is to export nothing.

The Ignore-Package header is purely informational from BND, it is ignored.

Additionally, requiring the system bundle is really bad practice.

-> richard

</instructions>
</configuration> </plugin>


Richard S. Hall wrote:
 On 7/20/10 1:20, Sudhir Dharmadhikari wrote:
I am trying simple osgi bundle which has every dependency embedded inside my bundle. By default, bundle-plugin creates several entries in Import-Package and Export-Package . I want to get rid of them completely. I tried several ways . If I try giving empty Import-Package , it fails at build. I tried blank _exportcontents, does not work too !

Any clue ?

I don't believe it should ever export anything by default, so if it is exporting it seems you must be telling it to do so somehow. On the other hand, it imports everything not included in the bundle by default. Not importing anything at all is harder than you might think. If you need any of the OSGi API then you need to import those packages; if you use any of the javax packages then you need to import them. But specifying !* should not import anything.

-> richard


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org

Reply via email to