title: What is a correct way to deploy an osgi-bundle to ServiceMix?
body: <p>I try to develop a starter application for Apache ServiceMix dealing with web services.</p>
  
  <p>1) I build the app (using 'mnv install' command)</p>
  
  <p>2) Deploy it to ServiceMix (using 'karaf@root> osgi:install mvn:com.company/ws-test-fuse/1.0.0-SNAPSHOT' command at server console)</p>
  
  <p>3) watch how it got installed ('osgi:list')</p>
  
  <pre><code>[ 157] [Installed  ] [            ] [       ] [   60] A Camel Spring Route (1.0.0.SNAPSHOT)
  </code></pre>
  
  <p>4) I try to start the app</p>
  
  <pre><code>karaf@root&gt;osgi:start 157
  </code></pre>
  
  <p>I get this: </p>
  
  <pre><code>org.osgi.framework.BundleException: Unresolved constraint in bundle com.company.ws-test-fuse [157]: Unable to resolve 157.0: missing requirement [157.0] package; (&amp;(package=commonj.sdo)(version&gt;=2.1.0)(!(version&gt;=3.0.0)))
  </code></pre>
  
  <p><strong>What is a correct way to install a bundle so all the maven dependencies get downloaded and installed automatically?</strong></p>
  
  <p><strong>Also, I am right that all the dependencies will be deployed to the osgi-container as osgi-bundles too?</strong></p>
  
  <p>My POM.xml is as follows:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
      license agreements. See the NOTICE file distributed with this work for additional 
      information regarding copyright ownership. The ASF licenses this file to 
      You under the Apache License, Version 2.0 (the "License"); you may not use 
      this file except in compliance with the License. You may obtain a copy of 
      the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
      by applicable law or agreed to in writing, software distributed under the 
      License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
      OF ANY KIND, either express or implied. See the License for the specific 
      language governing permissions and limitations under the License. --&gt;
  &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;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.company&lt;/groupId&gt;
      &lt;artifactId&gt;ws-test-fuse&lt;/artifactId&gt;
      &lt;packaging&gt;bundle&lt;/packaging&gt;
      &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
  
      &lt;name&gt;A Camel Spring Route&lt;/name&gt;
      &lt;url&gt;http://www.myorganization.org&lt;/url&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
      &lt;/properties&gt;
  
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;release.fusesource.org&lt;/id&gt;
              &lt;name&gt;FuseSource Release Repository&lt;/name&gt;
              &lt;url&gt;http://repo.fusesource.com/nexus/content/repositories/releases&lt;/url&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;false&lt;/enabled&gt;
              &lt;/snapshots&gt;
              &lt;releases&gt;
                  &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;/releases&gt;
          &lt;/repository&gt;
          &lt;repository&gt;
              &lt;id&gt;snapshot.fusesource.org&lt;/id&gt;
              &lt;name&gt;FuseSource Snapshot Repository&lt;/name&gt;
              &lt;url&gt;http://repo.fusesource.com/nexus/content/repositories/snapshots&lt;/url&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;/snapshots&gt;
              &lt;releases&gt;
                  &lt;enabled&gt;false&lt;/enabled&gt;
              &lt;/releases&gt;
          &lt;/repository&gt;
          &lt;repository&gt;
              &lt;id&gt;ea.fusesource.org&lt;/id&gt;
              &lt;name&gt;FuseSource Early Access Repository&lt;/name&gt;
              &lt;url&gt;http://repo.fusesource.com/nexus/content/groups/ea&lt;/url&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;false&lt;/enabled&gt;
              &lt;/snapshots&gt;
              &lt;releases&gt;
                  &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;/releases&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
  
      &lt;pluginRepositories&gt;
          &lt;pluginRepository&gt;
              &lt;id&gt;release.fusesource.org&lt;/id&gt;
              &lt;name&gt;FuseSource Release Repository&lt;/name&gt;
              &lt;url&gt;http://repo.fusesource.com/nexus/content/repositories/releases&lt;/url&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;false&lt;/enabled&gt;
              &lt;/snapshots&gt;
              &lt;releases&gt;
                  &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;/releases&gt;
          &lt;/pluginRepository&gt;
          &lt;pluginRepository&gt;
              &lt;id&gt;snapshot.fusesource.org&lt;/id&gt;
              &lt;name&gt;FuseSource Snapshot Repository&lt;/name&gt;
              &lt;url&gt;http://repo.fusesource.com/nexus/content/repositories/snapshots&lt;/url&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;/snapshots&gt;
              &lt;releases&gt;
                  &lt;enabled&gt;false&lt;/enabled&gt;
              &lt;/releases&gt;
          &lt;/pluginRepository&gt;
          &lt;pluginRepository&gt;
              &lt;id&gt;ea.fusesource.org&lt;/id&gt;
              &lt;name&gt;FuseSource Early Access Repository&lt;/name&gt;
              &lt;url&gt;http://repo.fusesource.com/nexus/content/groups/ea&lt;/url&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;false&lt;/enabled&gt;
              &lt;/snapshots&gt;
              &lt;releases&gt;
                  &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;/releases&gt;
          &lt;/pluginRepository&gt;
      &lt;/pluginRepositories&gt;
  
      &lt;dependencies&gt;
  
          &lt;!-- Core --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-core&lt;/artifactId&gt;
              &lt;version&gt;2.9.0.fuse-7-061&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-spring&lt;/artifactId&gt;
              &lt;version&gt;2.9.0.fuse-7-061&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Apache Cxf --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-cxf&lt;/artifactId&gt;
              &lt;version&gt;2.9.0.fuse-7-061&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-jetty&lt;/artifactId&gt;
              &lt;version&gt;2.9.0.fuse-7-061&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
              &lt;artifactId&gt;cxf-rt-transports-http-jetty&lt;/artifactId&gt;
              &lt;version&gt;2.5.0.fuse-7-061&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
              &lt;artifactId&gt;cxf-rt-databinding-sdo&lt;/artifactId&gt;
              &lt;version&gt;2.5.0.fuse-7-061&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;!-- Apache tuscany SDO --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.tuscany.sdo&lt;/groupId&gt;
              &lt;artifactId&gt;tuscany-sdo-api-r2.1&lt;/artifactId&gt;
              &lt;version&gt;1.1.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.tuscany.sdo&lt;/groupId&gt;
              &lt;artifactId&gt;tuscany-sdo-impl&lt;/artifactId&gt;
              &lt;version&gt;1.1.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.tuscany.sdo&lt;/groupId&gt;
              &lt;artifactId&gt;tuscany-sdo-lib&lt;/artifactId&gt;
              &lt;version&gt;1.1.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.tuscany.sdo&lt;/groupId&gt;
              &lt;artifactId&gt;tuscany-sdo-tools&lt;/artifactId&gt;
              &lt;version&gt;1.1.1&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- SDO Support --&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.eclipse.xsd&lt;/groupId&gt;
              &lt;artifactId&gt;xsd&lt;/artifactId&gt;
              &lt;version&gt;2.2.3&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.eclipse.xsd&lt;/groupId&gt;
              &lt;artifactId&gt;xsd&lt;/artifactId&gt;
              &lt;version&gt;2.2.3&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.eclipse.emf&lt;/groupId&gt;
              &lt;artifactId&gt;ecore&lt;/artifactId&gt;
              &lt;version&gt;2.2.3&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.eclipse.emf&lt;/groupId&gt;
              &lt;artifactId&gt;ecore-change&lt;/artifactId&gt;
              &lt;version&gt;2.2.3&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.eclipse.emf&lt;/groupId&gt;
              &lt;artifactId&gt;ecore-xmi&lt;/artifactId&gt;
              &lt;version&gt;2.2.3&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.eclipse.emf&lt;/groupId&gt;
              &lt;artifactId&gt;common&lt;/artifactId&gt;
              &lt;version&gt;2.2.3&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.eclipse.emf&lt;/groupId&gt;
              &lt;artifactId&gt;codegen-ecore&lt;/artifactId&gt;
              &lt;version&gt;2.2.3&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.eclipse.emf&lt;/groupId&gt;
              &lt;artifactId&gt;codegen&lt;/artifactId&gt;
              &lt;version&gt;2.2.3&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;backport-util-concurrent&lt;/groupId&gt;
              &lt;artifactId&gt;backport-util-concurrent&lt;/artifactId&gt;
              &lt;version&gt;3.0&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;!-- logging --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
              &lt;version&gt;1.6.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
              &lt;version&gt;1.6.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j&lt;/artifactId&gt;
              &lt;version&gt;1.2.16&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- testing --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-test&lt;/artifactId&gt;
              &lt;version&gt;2.9.0.fuse-7-061&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;defaultGoal&gt;install&lt;/defaultGoal&gt;
  
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.3.2&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.6&lt;/source&gt;
                      &lt;target&gt;1.6&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  
              &lt;!-- allows the route to be ran via 'mvn camel:run' --&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
                  &lt;artifactId&gt;camel-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.9.0.fuse-7-061&lt;/version&gt;
              &lt;/plugin&gt;
  
              &lt;!-- Maven bundle plugin --&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;2.3.7&lt;/version&gt;
                  &lt;extensions&gt;true&lt;/extensions&gt;
                  &lt;configuration&gt;
                      &lt;instructions&gt;
                          &lt;Import-Package&gt;*,org.apache.camel.osgi&lt;/Import-Package&gt;
                      &lt;/instructions&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>