title: karaf-felix custom distribution using maven
body: <p>I am currently deploying <code>maven</code> managed bundles into the <code>felix</code> framework and I want to create a <code>maven</code> project for the deployment process and want to automate all the process using maven plugins.</p>
  
  <p>Using <code>maven-dependency-plugin</code> we can somehow automate the deployment process.</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.8&lt;/version&gt;
       &lt;executions&gt;
           &lt;execution&gt;
               &lt;id&gt;unpack-felix&lt;/id&gt;
               &lt;phase&gt;compile&lt;/phase&gt;
               &lt;goals&gt;
                   &lt;goal&gt;unpack-dependencies&lt;/goal&gt;
               &lt;/goals&gt;
               &lt;configuration&gt;
                   &lt;includeArtifactIds&gt;org.apache.felix.ipojo.distribution.quickstart&lt;/includeArtifactIds&gt;
                   &lt;outputDirectory&gt;${project.build.directory}/tmp&lt;/outputDirectory&gt;
               &lt;/configuration&gt;
           &lt;/execution&gt;
           &lt;execution&gt;
               &lt;id&gt;copy-bundles&lt;/id&gt;
               &lt;phase&gt;package&lt;/phase&gt;
               &lt;goals&gt;
                   &lt;goal&gt;copy-dependencies&lt;/goal&gt;
               &lt;/goals&gt;
               &lt;configuration&gt;
                   &lt;includeArtifactIds&gt;
                       sample.maven.bundle1,
                       sample.maven.bundle2,
                       .
                       .
                       sample.maven.bundleN
                   &lt;/includeArtifactIds&gt;
                   &lt;outputDirectory&gt;${project.build.directory}/bundle&lt;/outputDirectory&gt;
               &lt;/configuration&gt;
           &lt;/execution&gt;
       &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>But all the bundles mentioned in the <code>&lt;includeArtifactIds&gt;</code> will be static and we might have problems updating them using <code>bundle:update</code> or <code>felix:update</code>.</p>
  
  <p>How can I deploy the bundles into <code>felix</code> or <code>karaf</code> the same as running <code>felix:deploy</code> inside <code>felix</code> but called using <code>maven</code> instead ?</p>