title: Maven : OSGI, bundles and multi-modules projects
body: <p>I'm currently developing an OSGi based application (using Equinox) by trying to mavenize a web tutorial I've found on OSGi+Equinox. In this project, there are bundles depending on other bundles (quote-service depends on quote).
  The compile phase does succeed, but the package phase does not. Maven complains the following :</p>
  
  <pre>
  [INFO] [bundle:bundle]
  [ERROR] Error building bundle de.vogella.osgi:quote-service:bundle:0.0.1 : Unresolved references to [de.vogella.osgi.quote] by class(es) on the Bundle-Classpath[Jar:dot]: [de/vogella/osgi/quoteservice/Activator.class, de/vogella/osgi/quoteservice/QuoteService.class]
  [ERROR] Error(s) found in bundle configuration
  </pre>
  
  <p>I do understand the problem, but do not see how to make it work.
  This is the quote's pom :</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" 
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
                               http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  
  &lt;parent&gt;
      &lt;artifactId&gt;osgi-first-app&lt;/artifactId&gt;
      &lt;groupId&gt;de.vogella.osgi&lt;/groupId&gt;
      &lt;version&gt;0.0.1&lt;/version&gt;
  &lt;/parent&gt;
  
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;de.vogella.osgi&lt;/groupId&gt;
  &lt;artifactId&gt;quote&lt;/artifactId&gt;
  &lt;packaging&gt;bundle&lt;/packaging&gt;
  &lt;name&gt;Quote Bundle&lt;/name&gt;
  &lt;version&gt;0.0.1&lt;/version&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
              &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.4.3&lt;/version&gt;
              &lt;extensions&gt;true&lt;/extensions&gt;
              &lt;configuration&gt;
                  &lt;instructions&gt;
                      &lt;_include&gt;src/main/resources/META-INF/MANIFEST.MF&lt;/_include&gt;
                  &lt;/instructions&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>and the quote's bundle manifest :</p>
  
  <pre><code>Manifest-Version: 1.0
  Bundle-ManifestVersion: 2
  Bundle-Name: Quote Plug-in
  Bundle-SymbolicName: de.vogella.osgi.quote
  Bundle-Activator: de.vogella.osgi.quote.Activator
  Bundle-ActivationPolicy: lazy
  Bundle-RequiredExecutionEnvironment: J2SE-1.5
  Import-Package: org.osgi.framework;version="1.3.0"
  Export-Package: de.vogella.osgi.quote
  </code></pre>
  
  <p>Then the quote-service's pom :</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" 
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
                               http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  
  &lt;parent&gt;
      &lt;artifactId&gt;osgi-first-app&lt;/artifactId&gt;
      &lt;groupId&gt;de.vogella.osgi&lt;/groupId&gt;
      &lt;version&gt;0.0.1&lt;/version&gt;
  &lt;/parent&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;de.vogella.osgi&lt;/groupId&gt;
          &lt;artifactId&gt;quote&lt;/artifactId&gt;
          &lt;version&gt;0.0.1&lt;/version&gt;
          &lt;type&gt;bundle&lt;/type&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;de.vogella.osgi&lt;/groupId&gt;
  &lt;artifactId&gt;quote-service&lt;/artifactId&gt;
  &lt;packaging&gt;bundle&lt;/packaging&gt;
  &lt;name&gt;Quote Service Bundle&lt;/name&gt;
  &lt;version&gt;0.0.1&lt;/version&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
              &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.4.3&lt;/version&gt;
              &lt;extensions&gt;true&lt;/extensions&gt;
              &lt;configuration&gt;
                  &lt;instructions&gt;
                      &lt;_include&gt;src/main/resources/META-INF/MANIFEST.MF&lt;/_include&gt;
                  &lt;/instructions&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>And finally the quote-service's manifest :</p>
  
  <pre><code>Manifest-Version: 1.0
  Bundle-ManifestVersion: 2
  Bundle-Name: Quoteservice Plug-in
  Bundle-SymbolicName: de.vogella.osgi.quoteservice
  Bundle-Activator: de.vogella.osgi.quoteservice.Activator
  Bundle-ActivationPolicy: lazy
  Bundle-RequiredExecutionEnvironment: J2SE-1.5
  Import-Package: org.osgi.framework;version="1.3.0", \
   de.vogella.osgi.quote;version="0.0.1"
  </code></pre>
  
  <p>Is there something wrong ? Thank you in advance !</p>