karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject svn commit: r1058614 - in /karaf/trunk/manual/src/main/webapp: developers-guide/creating-bundles.conf manual.conf
Date Thu, 13 Jan 2011 15:43:08 GMT
Author: jbonofre
Date: Thu Jan 13 15:43:07 2011
New Revision: 1058614

URL: http://svn.apache.org/viewvc?rev=1058614&view=rev
Log:
Add documentation regarding how to create bundle and wrap third party dependencies.

Modified:
    karaf/trunk/manual/src/main/webapp/developers-guide/creating-bundles.conf
    karaf/trunk/manual/src/main/webapp/manual.conf

Modified: karaf/trunk/manual/src/main/webapp/developers-guide/creating-bundles.conf
URL: http://svn.apache.org/viewvc/karaf/trunk/manual/src/main/webapp/developers-guide/creating-bundles.conf?rev=1058614&r1=1058613&r2=1058614&view=diff
==============================================================================
--- karaf/trunk/manual/src/main/webapp/developers-guide/creating-bundles.conf (original)
+++ karaf/trunk/manual/src/main/webapp/developers-guide/creating-bundles.conf Thu Jan 13 15:43:07
2011
@@ -1,4 +1,105 @@
 h1. Creating bundles for third party dependencies
 
-Some infos available at [http://gnodet.blogspot.com/2008/09/id-like-to-talk-bit-about-third-party.html],
[http://blog.springsource.com/2008/02/18/creating-osgi-bundles/] and [http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html].
+Karaf support the wrap: protocol execution.
+
+It allows you to directly deploy third party dependency, like Apache Commons Lang:
+
+{code}
+root@karaf> osgi:install wrap:mvn:commons-lang/commons-lang/2.4
+{code}
+
+You can specify OSGi statements on the wrap URL:
+
+{code}
+root@karaf> osgi:install wrap:mvn:commons-lang/commons-lang/2.4,Bundle-SymbolicName=commons-lang&Bundle-Version=2.4
+{code}
+
+Anyway, you can create a wrap bundle for a third party dependencies.
+This bundle is simply a Maven POM that shade an existing jar and package into a jar bundle.
+
+For instance, to create an OSGi bundle to wrap Apache Commons Lang, you can simply define
the following Maven POM:
+
+{code:lang=xml}
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>osgi.commons-lang</groupId>
+    <artifactId>osgi.commons-lang</artifactId>
+    <version>2.4</version>
+    <packaging>bundle</packaging>
+    <name>commons-lang OSGi Bundle</name>
+    <description>This OSGi bundle simply wraps commons-lang-2.4.jar artifact.</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+            <version>2.4</version>
+            <optional>true</optional>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <defaultGoal>install</defaultGoal>
+
+        <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-shade-plugin</artifactId>
+            <version>1.1</version>
+            <executions>
+                <execution>
+                    <phase>package</phase>
+                    <goals>
+                        <goal>shade</goal>
+                    </goals>
+                    <configuration>
+                        <artifactSet>
+                            <includes>
+                                <include>commons-lang:commons-lang</include>
+                            </includes>
+                        </artifactSet>
+                        <filters>
+                            <filter>
+                                <artifact>commons-lang:commons-lang</artifact>
+                                <excludes>
+                                    <exclude>**</exclude>
+                                </excludes>
+                            </filter>
+                        </filters>
+                        <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
+                        <createDependencyReducedPom>true</createDependencyReducedPom>
+                    </configuration>
+                </execution>
+            </executions>
+        </plugin>
+        <plugin>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>maven-bundle-plugin</artifactId>
+            <version>2.1.0</version>
+            <extensions>true</extensions>
+            <configuration>
+                <instructions>
+                    <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+                    <Export-Package></Export-Package>
+                    <Import-Package></Import-Package>
+                    <_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>
+                    <_removeheaders>Ignore-Package,Include-Resource,Private-Package,Embed-Dependency</_removeheaders>
+                </instructions>
+                <unpackBundle>true</unpackBundle>
+            </configuration>
+        </plugin>
+    </build>
+
+</project>
+{code}
+
+You have now a OSGi bundle for commons-lang that you can deploy directory:
+
+{code}
+root@karaf> osgi:install -s mvn:osgi.commons-lang/osgi.commons-lang/2.4
+{code}
+
+Some more infos available at [http://gnodet.blogspot.com/2008/09/id-like-to-talk-bit-about-third-party.html],
[http://blog.springsource.com/2008/02/18/creating-osgi-bundles/] and [http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html].
 

Modified: karaf/trunk/manual/src/main/webapp/manual.conf
URL: http://svn.apache.org/viewvc/karaf/trunk/manual/src/main/webapp/manual.conf?rev=1058614&r1=1058613&r2=1058614&view=diff
==============================================================================
--- karaf/trunk/manual/src/main/webapp/manual.conf (original)
+++ karaf/trunk/manual/src/main/webapp/manual.conf Thu Jan 13 15:43:07 2011
@@ -9,18 +9,28 @@ h1. Quick Start
 h1. Users Guide
 {include:users-guide/installation.conf}
 {include:users-guide/start-stop.conf}
+{include:users-guide/configuration.conf}
 {include:users-guide/using-console.conf}
+{include:users-guide/colorized-console.conf}
 {include:users-guide/web-console.conf}
 {include:users-guide/remote-console.conf}
+{include:users-guide/deployer.conf}
 {include:users-guide/child-instances.conf}
 {include:users-guide/security.conf}
 {include:users-guide/failover.conf}
 {include:users-guide/logging-system.conf}
+{include:users-guide/provisioning.conf}
+{include:users-guide/provisioning-schema.conf}
 
 h1. Developers Guide
+{include:developers-guide/connect-console.conf}
+{include:developers-guide/shell-syntax.conf}
+{include:developers-guide/creating-bundles.conf}
+{include:developers-guide/debugging.conf}
 {include:developers-guide/extending-console.conf}
-{include:developers-guide/security-framework.conf}
 {include:developers-guide/features-maven-plugin.conf}
 {include:developers-guide/features-maven-plugin-add.conf}
 {include:developers-guide/features-maven-plugin-generate.conf}
 {include:developers-guide/features-maven-plugin-validate.conf}
+{include:developers-guide/security-framework.conf}
+{include:developers-guide/writing-tests.conf}
\ No newline at end of file



Mime
View raw message