FELIX-1976 Create build profile to generate a bundle without embedded dependencies which can be imported

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@898224 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole/pom.xml b/webconsole/pom.xml
index 240dd03..47f14a5 100644
--- a/webconsole/pom.xml
+++ b/webconsole/pom.xml
@@ -79,7 +79,6 @@
                             javax.portlet;resolution:=optional,
                             javax.servlet.*;version=2.4,*;
                         </Import-Package>
-                        
                         <Embed-Dependency>
                             <!-- Import/Export-Package parsing -->
                             org.apache.felix.bundlerepository;
@@ -96,16 +95,70 @@
                             
                             <!-- File Upload functionality -->
                             commons-fileupload,
-
+    
                             <!-- Required by FileUpload and Util -->
                             commons-io
                         </Embed-Dependency>
+                        
+                        <_donotcopy>NOTICE.bare</_donotcopy>
+                        <_removeheaders>
+                            Embed-Dependency,Private-Package,Include-Resource
+                        </_removeheaders>
                     </instructions>
                 </configuration>
             </plugin>
         </plugins>
     </build>
 
+    <profiles>
+        <!--
+            The "bare-bundle" profile builds a bundle not including certain
+            3rd party libraries and classes, namely: Commons IO, Commons
+            FileUpload, JSON, and the OSGi ServiceTracker. These are imported
+            by this bundle. The classes from the bundlerepository bundle are
+            still included because they are not exported from the
+            bundlerepository bundle and thus cannot be imported.
+            The "bare-bundle" can be used if the non-embedded libraries are
+            provided by the framework in which the web console is installed.
+        -->
+        <profile>
+            <id>bare-bundle</id>
+            <activation><activeByDefault>true</activeByDefault></activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.felix</groupId>
+                        <artifactId>maven-bundle-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>bare-bundle</id>
+                                <goals>
+                                    <goal>bundle</goal>
+                                </goals>
+                                <configuration>
+                                    <classifier>bare</classifier>
+                                    <instructions>
+                                        <Include-Resource>
+                                            {maven-resources},META-INF/NOTICE=src/main/bare-resources/NOTICE.bare
+                                        </Include-Resource>
+                                        <_donotcopy>LICENSE.json</_donotcopy>
+                                        <!-- <_donotcopy>(LICENSE.json|NOTICE.bare)</_donotcopy> -->
+                                        <Embed-Dependency>
+                                            org.apache.felix.bundlerepository;
+                                                inline=org/apache/felix/bundlerepository/R4*.class|
+                                                    org/apache/felix/bundlerepository/Util.class|
+                                                    org/apache/felix/bundlerepository/VersionRange.class,
+                                        </Embed-Dependency>
+                                    </instructions>
+                                </configuration>
+                            </execution>
+                        </executions>
+                </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+    
     <dependencies>
         <dependency>
             <groupId>javax.servlet</groupId>
diff --git a/webconsole/src/main/bare-resources/NOTICE b/webconsole/src/main/bare-resources/NOTICE
new file mode 100644
index 0000000..5a156a3
--- /dev/null
+++ b/webconsole/src/main/bare-resources/NOTICE
@@ -0,0 +1,55 @@
+Apache Felix OSGi Web Console
+Copyright 2007-2009 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 developed at
+The OSGi Alliance (http://www.osgi.org/).
+Copyright (c) OSGi Alliance (2000, 2009).
+Licensed under the Apache License 2.0.
+
+This product includes software from http://www.jquery.com
+Copyright (c) 2009 John Resig, http://jquery.com/
+Licensed under the MIT License
+
+This product includes software from http://tablesorter.com
+Copyright (c) 2007 Christian Bach
+Licensed under the MIT License
+
+This product includes software from http://www.fyneworks.com
+Copyright (c) 2008 Fyneworks.com
+Licensed under the MIT License
+
+This product includes icons from the Silk Icon set
+(http://www.famfamfam.com/lab/icons/silk/)
+Copyright (c) 2006 Mark James
+Licensed under the Creative Commons Attribution 2.5 License
+
+This product includes software from http://benchsketch.com/bquery/index.html
+Copyright (c) 2009 Tanner Hildebrand
+Licensed under Tanner Hildebrand's License
+
+This product includes software from http://code.google.com/p/cookies/
+Copyright (c) 2005 - 2009, James Auldridge
+Licensed under the MIT License
+
+
+II. Used Software
+
+This product uses software developed at
+The OSGi Alliance (http://www.osgi.org/).
+Copyright (c) OSGi Alliance (2000, 2009).
+Licensed under the Apache License 2.0.
+
+
+III. License Summary
+- Apache License 2.0
+- JSON License
+- MIT License
+- Creative Commons Attribution 2.5 License
+- Tanner Hildebrand's License
\ No newline at end of file