How to form the .bnd files while using maven-bundle-plugin?
<p>I'd like to build osgi components and I have been told to use <code>maven-bundle-plugin</code>. I started off by adding this into my <code>pom.xml</code>:</p>

<pre><code>        &lt;plugin&gt;
                &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
                &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;
                &lt;version&gt;3.0.0&lt;/version&gt;
                &lt;extensions&gt;true&lt;/extensions&gt;
                &lt;configuration&gt;
                    &lt;obrRepository&gt;NONE&lt;/obrRepository&gt;
                    &lt;instructions&gt;
                        &lt;_include&gt;-bnd.bnd&lt;/_include&gt;
                    &lt;/instructions&gt;
                &lt;/configuration&gt;
        &lt;/plugin&gt;
</code></pre>

<p>Notice the <code>.bnd</code> file which is passed to <code>&lt;_include&gt;</code> tag. I've heard people saying that these files should be kept at minimum, or even empty, and then should be observed what imports/exports are needed, etc. This is where I get confused. I have my <code>MANIFEST.MF</code> file, in which I know what to import and export. However, I need a bit of help to make my <code>.bnd</code> files working. Right now I am trying with empty <code>.bnd</code> files and I am not sure if it is working as it should be. </p>

<p>Does anyone have any experience with this plugin and the way I want to make it work?</p>

<p>For instance, <a href="https://github.com/evandor/skysail-bundled-libraries/blob/master/skysail.bundles.beanutils/osgi.bnd" rel="nofollow">here</a> is a sample <code>.bnd</code> file. However I don't know how he decided that these should imports/exports be there.</p>

<p>As of now, when I try to test the <code>.jar</code> I get</p>

<pre><code>no main manifest attribute, in bundle-1.0.0.jar
</code></pre>

<p>error despite of the fact that there is indeed <code>MANIFEST.MF</code> in the <code>.jar</code>.</p>

<p><strong>Update:</strong> I thought I could share the <code>MANIFEST.MF</code> that I had previously, which I want to generate via this plugin now.</p>

<pre><code>Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Just a Name
Bundle-SymbolicName: just.a.name.broker;singleton:=true
Bundle-Version: 1.0.0
Require-Bundle: org.apache.activemq,
 just.msg
Bundle-Activator: just.a.broker.Activator
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Import-Package: javax.naming,
 javax.xml,
 javax.xml.parsers,
 org.apache.log4j.xml,
 org.osgi.framework
Bundle-ClassPath: .
Export-Package: just.a.broker
</code></pre>

<p>So in order to have such a manifest, how should my <code>.bnd</code> file look like? Or is it better to include the properties in the plugin rather than passing the <code>.bnd</code> file?</p>