title: Apache Karaf feature prerequisite
body: <p>Karaf 4.0.3</p>
  
  <p>I have the following pseudo-feature:</p>
  
  <pre><code>&lt;features name="my-feature" xmlns="http://karaf.apache.org/xmlns/features/v1.3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                             xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.3.0 http://karaf.apache.org/xmlns/features/v1.3.0"&gt;
  &lt;feature name="C" version="${project.version}" start-level="25" install="auto"&gt;
      &lt;bundle start-level="25"&gt;...BundleC1...&lt;/bundle&gt;
  &lt;/feature&gt;
  
  &lt;feature name="A" version="${project.version}" start-level="30" install="auto"&gt;
      &lt;feature prerequisite="true"&gt;C&lt;/feature&gt;
      &lt;bundle start-level="30"&gt;...BundleA1...&lt;/bundle&gt;
  &lt;/feature&gt;
  
  &lt;feature name="B" version="${project.version}" start-level="35" install="auto"&gt;
      &lt;feature prerequisite="true"&gt;C&lt;/feature&gt;
      &lt;bundle start-level="35"&gt;...BundleB1...&lt;/bundle&gt;
  &lt;/feature&gt;
  </code></pre>
  
  <p></p>
  
  <p>C is independant<br/>
  A depends on C<br/>
  B depends on C</p>
  
  <p>In this example the bundle 'BundleB1' imports wrong major version of 'BundleC1' and we get the "missing requirement" error (as expected). However if I log into the karaf console and run 'feature:list' I will see that C is Started, A is Uninstalled and B is Uninstalled.</p>
  
  <p>I expect A to be Started since it only has dependencies to C. A will start fine if I comment out the entire C feature or if I afterwards run <code>feature:install A</code></p>
  
  <p>If I put each of these three features in seperate feature.xml files I get the expected outcome of C+A as Started and B as Uninstalled.</p>
  
  <p>What am I doing wrong? </p>
  
  <p>Am I misunderstanding how the prerequisite attribute works? As a sidenote, if I skip the prerequisite attribute all together then no feature will get installed whatsover...</p>