title: How to include resource file into osgi bundle from jar dependency with bnd/maven-bundle-plugin?
body: <p>I'm using <code>maven-bundle-plugin</code> (<code>bnd</code> effectively).</p>
  
  <p>It's straightforward to include a resource file from sources.</p>
  
  <p>For example, a resource file (<code>src/main/resources/some.xml</code>) is moved under <code>target</code> directory (<code>target/classes/some.xml</code>) during build time and can be included into the bundle using <code>&lt;Include-Resource&gt;</code> instruction:</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.1&lt;/version&gt;
      &lt;extensions&gt;true&lt;/extensions&gt;
      &lt;configuration&gt;
          &lt;instructions&gt;
              &lt;Include-Resource&gt;
                  some.xml=target/classes/some.xml,
              &lt;/Include-Resource&gt;
          &lt;/instructions&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>Let us have a dependency:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;com.example&lt;/groupId&gt;
      &lt;artifactId&gt;library&lt;/artifactId&gt;
      &lt;version&gt;1.0.0&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p><strong>How to reference resource file inside dependent <code>jar</code>?</strong></p>
  
  <p>In other words, how to</p>
  
  <ul>
  <li><p>specify something like this:</p>
  
  <pre><code>com.example:library:1.0.0:jar/some.xml
  </code></pre></li>
  <li><p>instead of this:</p>
  
  <pre><code>target/classes/some.xml
  </code></pre></li>
  </ul>
  
  <p>so that resource from one of the dependency appeared in output bundle <code>jar</code>?</p>