Fix FELIX-4267 Define Apache Karaf features for iPOJO


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1528551 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/runtime/karaf-feature/pom.xml b/ipojo/runtime/karaf-feature/pom.xml
new file mode 100644
index 0000000..00fb9f9
--- /dev/null
+++ b/ipojo/runtime/karaf-feature/pom.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<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>org.apache.felix</groupId>
+    <artifactId>org.apache.felix.ipojo.features</artifactId>
+    <version>1.10.2-SNAPSHOT</version>
+
+    <name>Apache Felix iPOJO Karaf Features</name>
+    <description>Apache Karaf Features to provision Apache Felix iPOJO</description>
+
+    <packaging>pom</packaging>
+
+    <properties>
+        <ipojo.webconsole.version>1.7.0</ipojo.webconsole.version>
+    </properties>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <version>2.6</version>
+                <executions>
+                    <execution>
+                        <phase>validate</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${project.build.directory}</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>src/main/features</directory>
+                                    <filtering>true</filtering>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <version>1.8</version>
+                <executions>
+                    <execution>
+                        <id>attach-artifacts</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>attach-artifact</goal>
+                        </goals>
+                        <configuration>
+                            <artifacts>
+                                <artifact>
+                                    <file>${project.build.directory}/features.xml</file>
+                                    <type>xml</type>
+                                </artifact>
+                            </artifacts>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file
diff --git a/ipojo/runtime/karaf-feature/src/main/features/features.xml b/ipojo/runtime/karaf-feature/src/main/features/features.xml
new file mode 100644
index 0000000..d35997f
--- /dev/null
+++ b/ipojo/runtime/karaf-feature/src/main/features/features.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0" name="${project.artifactId}">
+
+
+    <feature name="ipojo" version="${project.version}"
+             description="Apache Felix iPOJO Core Runtime">
+        <bundle>mvn:${project.groupId}/org.apache.felix.ipojo/${project.version}</bundle>
+    </feature>
+
+    <feature name="ipojo-command" version="${project.version}"
+             description="Apache Felix iPOJO Shell Command">
+        <feature version="${project.version}">ipojo</feature>
+        <bundle>mvn:${project.groupId}/org.apache.felix.ipojo.gogo/${project.version}</bundle>
+    </feature>
+
+    <feature name="ipojo-all" version="${project.version}"
+             description="Apache Felix iPOJO All Runtime Bundles">
+        <feature version="${project.version}">ipojo-command</feature>
+        <bundle>mvn:${project.groupId}/org.apache.felix.ipojo.composite/${project.version}</bundle>
+        <bundle>mvn:${project.groupId}/org.apache.felix.ipojo.api/${project.version}</bundle>
+    </feature>
+
+    <feature name="ipojo-webconsole" version="${project.version}"
+             description="Apache Felix iPOJO Web Console Plugin">
+        <feature version="${project.version}">ipojo</feature>
+        <feature>webconsole</feature>
+        <bundle>mvn:${project.groupId}/org.apache.felix.ipojo.webconsole/${ipojo.webconsole.version}</bundle>
+    </feature>
+</features>
\ No newline at end of file
diff --git a/ipojo/runtime/pom.xml b/ipojo/runtime/pom.xml
index 1edd304..f78e9f7 100644
--- a/ipojo/runtime/pom.xml
+++ b/ipojo/runtime/pom.xml
@@ -40,9 +40,23 @@
         <module>core-it</module>
         <module>composite-it</module>
         <module>ipojo-gogo-commands</module>
-        <module>distributions/quickstart</module>
+        <module>karaf-feature</module>
     </modules>
 
+    <profiles>
+        <profile>
+            <id>distributions</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <modules>
+                <module>distributions/quickstart</module>
+                <module>distributions/ten-minutes-tutorial</module>
+                <module>distributions/maven-tutorial</module>
+            </modules>
+        </profile>
+    </profiles>
+
     <scm>
         <connection>scm:svn:http://svn.apache.org/repos/asf/felix/trunk/ipojo/runtime</connection>
         <developerConnection>scm:svn:https://svn.apache.org/repos/asf/felix/trunk/ipojo/runtime</developerConnection>