You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jg...@apache.org on 2012/03/22 20:03:12 UTC

svn commit: r1303986 - in /karaf/branches/karaf-2.2.x: assemblies/apache-karaf/src/main/filtered-resources/demos/deployer/wrap/ demos/deployer/ demos/deployer/wrap/ manual/src/main/webapp/developers-guide/

Author: jgoodyear
Date: Thu Mar 22 19:03:11 2012
New Revision: 1303986

URL: http://svn.apache.org/viewvc?rev=1303986&view=rev
Log:
[KARAF-1280] Add wrap third party jar example.

Added demo for wrapping a third party jar using
the shade plugin.


Added:
    karaf/branches/karaf-2.2.x/assemblies/apache-karaf/src/main/filtered-resources/demos/deployer/wrap/
    karaf/branches/karaf-2.2.x/assemblies/apache-karaf/src/main/filtered-resources/demos/deployer/wrap/README.txt
    karaf/branches/karaf-2.2.x/demos/deployer/wrap/
    karaf/branches/karaf-2.2.x/demos/deployer/wrap/NOTICE
    karaf/branches/karaf-2.2.x/demos/deployer/wrap/pom.xml
Modified:
    karaf/branches/karaf-2.2.x/demos/deployer/pom.xml
    karaf/branches/karaf-2.2.x/manual/src/main/webapp/developers-guide/creating-bundles.conf

Added: karaf/branches/karaf-2.2.x/assemblies/apache-karaf/src/main/filtered-resources/demos/deployer/wrap/README.txt
URL: http://svn.apache.org/viewvc/karaf/branches/karaf-2.2.x/assemblies/apache-karaf/src/main/filtered-resources/demos/deployer/wrap/README.txt?rev=1303986&view=auto
==============================================================================
--- karaf/branches/karaf-2.2.x/assemblies/apache-karaf/src/main/filtered-resources/demos/deployer/wrap/README.txt (added)
+++ karaf/branches/karaf-2.2.x/assemblies/apache-karaf/src/main/filtered-resources/demos/deployer/wrap/README.txt Thu Mar 22 19:03:11 2012
@@ -0,0 +1,61 @@
+/* 
+ * 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.
+ */
+
+Creating Bundles for Third Party Dependencies EXAMPLE
+=====================================================
+
+Purpose
+-------
+Demonstrate how to create a wrap bundle for a third
+party dependency.
+
+
+Prerequisites for Running this Example
+--------------------------------------
+You must have the following installed on your machine:
+
+   - JDK 1.6 or higher.
+
+   - Apache Maven 2.2.1 or higher.
+
+
+Building and Deploying
+----------------------
+This example will produce a bundle. 
+
+To build the wrap demo invoke the following command:
+
+  mvn install
+
+In the Maven POM file a shade plugin has been configured
+to take an existing jar and package it as a jar bundle. In
+this case the bundle produced exports the commons lang
+packages.
+
+The generated bundle deploys as per usual syntax:
+
+  karaf@root> osgi:install -s mvn:osgi.commons-lang/osgi.commons-lang/2.4
+
+Once installed you may confirm its operation by invoking
+the following command:
+
+  karaf@root> list | grep -i osgi.commons-lang 
+  [  50] [Active     ] [            ] [   60] Apache Karaf :: Demos :: Deployer :: Wrap Bundle osgi.commons-lang (2.4.0)
+
+For more information on creating bundles for third party 
+dependencies please visit:
+http://karaf.apache.org/manual/latest-2.2.x/developers-guide/creating-bundles.html

Modified: karaf/branches/karaf-2.2.x/demos/deployer/pom.xml
URL: http://svn.apache.org/viewvc/karaf/branches/karaf-2.2.x/demos/deployer/pom.xml?rev=1303986&r1=1303985&r2=1303986&view=diff
==============================================================================
--- karaf/branches/karaf-2.2.x/demos/deployer/pom.xml (original)
+++ karaf/branches/karaf-2.2.x/demos/deployer/pom.xml Thu Mar 22 19:03:11 2012
@@ -34,6 +34,7 @@
 
     <modules>
         <module>kar</module>
+        <module>wrap</module>
     </modules>
 
 </project>

Added: karaf/branches/karaf-2.2.x/demos/deployer/wrap/NOTICE
URL: http://svn.apache.org/viewvc/karaf/branches/karaf-2.2.x/demos/deployer/wrap/NOTICE?rev=1303986&view=auto
==============================================================================
--- karaf/branches/karaf-2.2.x/demos/deployer/wrap/NOTICE (added)
+++ karaf/branches/karaf-2.2.x/demos/deployer/wrap/NOTICE Thu Mar 22 19:03:11 2012
@@ -0,0 +1,48 @@
+Apache Karaf
+Copyright 2010-2012 The Apache Software Foundation
+
+
+I. Included Software
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+Licensed under the Apache License 2.0.
+
+This product includes software written by
+Antony Lesuisse.
+Licensed under Public Domain.
+
+
+II. Used Software
+
+This product uses software developed at
+The OSGi Alliance (http://www.osgi.org/).
+Copyright (c) OSGi Alliance (2000, 2010).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+OPS4J (http://www.ops4j.org/).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+FUSE Source (http://www.fusesource.org/).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+Tanuki Software (http://www.tanukisoftware.com/).
+Licensed under the Apache License 2.0.
+
+This product uses software developed at
+JLine (http://jline.sourceforge.net).
+Licensed under the BSD License.
+
+This product uses software developed at
+SLF4J (http://www.slf4j.org/).
+Licensed under the MIT License.
+
+This product includes software from http://www.json.org.
+Copyright (c) 2002 JSON.org
+
+
+III. License Summary
+- Apache License 2.0

Added: karaf/branches/karaf-2.2.x/demos/deployer/wrap/pom.xml
URL: http://svn.apache.org/viewvc/karaf/branches/karaf-2.2.x/demos/deployer/wrap/pom.xml?rev=1303986&view=auto
==============================================================================
--- karaf/branches/karaf-2.2.x/demos/deployer/wrap/pom.xml (added)
+++ karaf/branches/karaf-2.2.x/demos/deployer/wrap/pom.xml Thu Mar 22 19:03:11 2012
@@ -0,0 +1,99 @@
+<?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">
+
+    <!--
+
+        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.
+    -->
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.karaf.demos</groupId>
+        <artifactId>org.apache.karaf.demos.deployer</artifactId>
+        <version>2.2.6-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <groupId>osgi.commons-lang</groupId>
+    <artifactId>osgi.commons-lang</artifactId>
+    <version>2.4</version>
+    <packaging>bundle</packaging>
+    <name>Apache Karaf :: Demos :: Deployer :: Wrap Bundle osgi.commons-lang</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>
+        <plugins>
+            <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>
+                                <excludes>
+                                    <exclude>**</exclude>
+                                </excludes>
+                            </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.3.7</version>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>manual</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>
+        </plugins>
+    </build>
+</project>

Modified: karaf/branches/karaf-2.2.x/manual/src/main/webapp/developers-guide/creating-bundles.conf
URL: http://svn.apache.org/viewvc/karaf/branches/karaf-2.2.x/manual/src/main/webapp/developers-guide/creating-bundles.conf?rev=1303986&r1=1303985&r2=1303986&view=diff
==============================================================================
--- karaf/branches/karaf-2.2.x/manual/src/main/webapp/developers-guide/creating-bundles.conf (original)
+++ karaf/branches/karaf-2.2.x/manual/src/main/webapp/developers-guide/creating-bundles.conf Thu Mar 22 19:03:11 2012
@@ -156,7 +156,7 @@ For instance, to create an OSGi bundle t
             <configuration>
                 <instructions>
                     <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
-                    <Export-Package></Export-Package>
+                    <Export-Package>*</Export-Package>
                     <Import-Package></Import-Package>
                     <_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>
                     <_removeheaders>Ignore-Package,Include-Resource,Private-Package,Embed-Dependency</_removeheaders>