| h1. OBR commands |
| |
| To install a repository in the OBR service, you have to use: |
| |
| {code} |
| karaf@root> cave:repository-install cave-repo |
| {code} |
| |
| Now, you can see the repository OBR metadata register in the OBR service: |
| |
| {code} |
| karaf@root> obr:listurl |
| file:/home/jbonofre/apache-karaf-2.2.2/cave/cave-repo/repository.xml |
| {code} |
| |
| And the OSGi bundles present in the repository OSGi bundles are available in the OBR service: |
| |
| {code} |
| karaf@root> obr:list |
| [...] |
| slf4j.log4j12 - slf4j-log4j12 (1.6.1) |
| slf4j.simple - slf4j-simple (1.6.1) |
| org.springframework.aop - Spring AOP (3.0.5.RELEASE) |
| org.springframework.asm - Spring ASM (3.0.5.RELEASE) |
| org.springframework.beans - Spring Beans (3.0.5.RELEASE) |
| org.springframework.context - Spring Context (3.0.5.RELEASE) |
| org.springframework.core - Spring Core (3.0.5.RELEASE) |
| org.springframework.expression - Spring Expression Language (3.0.5.RELEASE) |
| org.springframework.web - Spring Web (3.0.5.RELEASE) |
| org.springframework.osgi.extensions.annotations - spring-osgi-annotation (1.2.1) |
| org.springframework.osgi.core - spring-osgi-core (1.2.1) |
| org.springframework.osgi.extender - spring-osgi-extender (1.2.1) |
| org.springframework.osgi.io - spring-osgi-io (1.2.1) |
| stax2-api - Stax2 API (3.1.1) |
| stax2-api - Stax2 API (3.0.2) |
| woodstox-core-asl - Woodstox XML-processor (4.1.1) |
| org.apache.ws.xmlschema.core - XmlSchema Core (2.0.0) |
| {code} |
| |
| You can get some detail about an OSGi bundle: |
| |
| {code} |
| karaf@root> obr:info slf4j.api,1.6.1 |
| --------- |
| slf4j-api |
| --------- |
| id: slf4j.api/1.6.1 |
| description: The slf4j API |
| symbolicname: slf4j.api |
| presentationname: slf4j-api |
| uri: file:/home/jbonofre/apache-karaf-2.2.2/cave/cave-repo/slf4j-api-1.6.1.jar |
| size: 25496 |
| version: 1.6.1 |
| Requires: |
| package:(&(package=org.slf4j.impl)(version>=1.6.0)) |
| ee:(|(ee=J2SE-1.3)) |
| Capabilities: |
| bundle:{manifestversion=2, symbolicname=slf4j.api, presentationname=slf4j-api, version=1.6.1} |
| package:{package=org.slf4j, version=1.6.1} |
| package:{package=org.slf4j.spi, version=1.6.1} |
| package:{package=org.slf4j.helpers, version=1.6.1} |
| {code} |
| |
| NB: in Apache Karaf, the OBR entry format is symbolicname,version |
| |
| You have the details of the OSGi bundle, especially the requirements and capabilities of the bundle. |
| |
| OBR is able to resolve the dependencies between bundles, depending of the requirements and capabilities of each bundle. |
| It's able to manage version, etc. |
| |
| For instance, we have the following commons-pool bundle details: |
| |
| {code} |
| karaf@root> obr:info org.apache.servicemix.bundles.commons-dbcp |
| -------------------------------------------- |
| Apache ServiceMix :: Bundles :: commons-dbcp |
| -------------------------------------------- |
| id: org.apache.servicemix.bundles.commons-dbcp/1.4.0.1 |
| description: This OSGi bundle wraps commons-dbcp 1.4 jar file. |
| documentation: http://www.apache.org/ |
| symbolicname: org.apache.servicemix.bundles.commons-dbcp |
| presentationname: Apache ServiceMix :: Bundles :: commons-dbcp |
| license: http://www.apache.org/licenses/LICENSE-2.0.txt |
| uri: file:/home/jbonofre/apache-karaf-2.2.2/cave/cave-repo/org.apache.servicemix.bundles.commons-dbcp-1.4.0.1.jar |
| size: 159721 |
| version: 1.4.0.1 |
| Requires: |
| package:(&(package=javax.naming)) |
| package:(&(package=javax.naming.spi)) |
| package:(&(package=javax.sql)) |
| package:(&(package=javax.transaction)) |
| package:(&(package=javax.transaction.xa)) |
| package:(&(package=org.apache.commons.pool)(version>=1.3.0)(!(version>=2.0.0))) |
| package:(&(package=org.apache.commons.pool.impl)(version>=1.3.0)(!(version>=2.0.0))) |
| package:(&(package=org.xml.sax)) |
| package:(&(package=org.xml.sax.helpers)) |
| Capabilities: |
| bundle:{manifestversion=2, symbolicname=org.apache.servicemix.bundles.commons-dbcp, presentationname=Apache ServiceMix :: Bundles :: commons-dbcp, version=1.4.0.1} |
| package:{package=org.apache.commons.dbcp.cpdsadapter, uses:=org.apache.commons.dbcp,javax.naming,javax.sql,org.apache.commons.pool.impl,org.apache.commons.pool,javax.naming.spi, version=1.4.0} |
| package:{package=org.apache.commons.dbcp, uses:=org.apache.commons.pool.impl,org.apache.commons.pool,javax.sql,javax.naming,javax.naming.spi,org.apache.commons.jocl,org.xml.sax, version=1.4.0} |
| package:{package=org.apache.commons.dbcp.managed, uses:=org.apache.commons.dbcp,javax.sql,org.apache.commons.pool.impl,javax.transaction,org.apache.commons.pool,javax.transaction.xa, version=1.4.0} |
| package:{package=org.apache.commons.dbcp.datasources, uses:=javax.sql,org.apache.commons.pool,javax.naming,org.apache.commons.dbcp,javax.naming.spi,org.apache.commons.pool.impl, version=1.4.0} |
| package:{package=org.apache.commons.jocl, uses:=org.xml.sax.helpers,org.xml.sax, version=1.4.0} |
| {code} |
| |
| We can see that commons-dbcp requires org.apache.commons.pool package (between version 1.3.0 and 2.0.0). |
| |
| If we take a look on commons-pool bundle details: |
| |
| {code} |
| karaf@root> obr:info org.apache.servicemix.bundles.commons-pool |
| -------------------------------------------- |
| Apache ServiceMix :: Bundles :: commons-pool |
| -------------------------------------------- |
| id: org.apache.servicemix.bundles.commons-pool/1.5.4.3 |
| description: This OSGi bundle wraps commons-pool 1.5.4 jar file. |
| documentation: http://www.apache.org/ |
| symbolicname: org.apache.servicemix.bundles.commons-pool |
| presentationname: Apache ServiceMix :: Bundles :: commons-pool |
| license: http://www.apache.org/licenses/LICENSE-2.0.txt |
| uri: file:/home/jbonofre/apache-karaf-2.2.2/cave/cave-repo/org.apache.servicemix.bundles.commons-pool-1.5.4.3.jar |
| size: 97332 |
| version: 1.5.4.3 |
| Capabilities: |
| bundle:{manifestversion=2, symbolicname=org.apache.servicemix.bundles.commons-pool, presentationname=Apache ServiceMix :: Bundles :: commons-pool, version=1.5.4.3} |
| package:{package=org.apache.commons.pool.impl, uses:=org.apache.commons.pool, version=1.5.4} |
| package:{package=org.apache.commons.pool, version=1.5.4} |
| {code} |
| |
| This bundle provides package org.apache.commons.pool capability. |
| |
| It means that if I deploy the commons-dbcp bundle, the OBR should also install the commons-pool bundle: |
| |
| {code} |
| karaf@root> obr:deploy org.apache.servicemix.bundles.commons-dbcp |
| Target resource(s): |
| ------------------- |
| Apache ServiceMix :: Bundles :: commons-dbcp (1.4.0.1) |
| |
| Required resource(s): |
| --------------------- |
| Apache ServiceMix :: Bundles :: commons-pool (1.5.4.3) |
| |
| Deploying...done. |
| {code} |
| |
| Done: the OBR has resolved the commons-dbcp requirements using the commons-pool capabilities and so installed the |
| commons-pool bundle. |
| |
| NB: in the {{obr:deploy}} command, if you don't mention the version, it will take the highly version available. |