You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ro...@apache.org on 2018/12/19 22:29:51 UTC

svn commit: r1849343 - in /felix/trunk/gogo: ./ command/ command/src/main/java/org/apache/felix/gogo/command/ gogo-parent/ jline/ jline/src/main/java/org/apache/felix/gogo/jline/ runtime/ runtime/src/main/java/org/apache/felix/gogo/runtime/ runtime/src...

Author: rotty3000
Date: Wed Dec 19 22:29:51 2018
New Revision: 1849343

URL: http://svn.apache.org/viewvc?rev=1849343&view=rev
Log:
FELIX-5970 Add requirement & capabilities model so gogo can be resolved

Signed-off-by: Raymond Auge <ro...@apache.org>

Added:
    felix/trunk/gogo/command/src/main/java/org/apache/felix/gogo/command/package-info.java
    felix/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/package-info.java
    felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/package-info.java
    felix/trunk/gogo/runtime/src/main/java/org/apache/felix/service/command/annotation/
    felix/trunk/gogo/runtime/src/main/java/org/apache/felix/service/command/annotation/RequireGogo.java
    felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/package-info.java
Modified:
    felix/trunk/gogo/command/pom.xml
    felix/trunk/gogo/command/src/main/java/org/apache/felix/gogo/command/Activator.java
    felix/trunk/gogo/gogo-parent/pom.xml
    felix/trunk/gogo/jline/pom.xml
    felix/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/Activator.java
    felix/trunk/gogo/pom.xml
    felix/trunk/gogo/runtime/pom.xml
    felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/CommandProcessorImpl.java
    felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/activator/Activator.java
    felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/threadio/ThreadIOImpl.java
    felix/trunk/gogo/shell/pom.xml
    felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Activator.java
    felix/trunk/gogo/shell/src/main/resources/gosh_profile

Modified: felix/trunk/gogo/command/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/command/pom.xml?rev=1849343&r1=1849342&r2=1849343&view=diff
==============================================================================
--- felix/trunk/gogo/command/pom.xml (original)
+++ felix/trunk/gogo/command/pom.xml Wed Dec 19 22:29:51 2018
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.felix</groupId>
         <artifactId>gogo-parent</artifactId>
-        <version>4</version>
+        <version>5-SNAPSHOT</version>
         <relativePath>../gogo-parent/pom.xml</relativePath>
     </parent>
 
@@ -39,13 +39,15 @@
     <dependencies>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>osgi.core</artifactId>
-            <scope>provided</scope>
+            <artifactId>org.osgi.service.log</artifactId>
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>osgi.cmpn</artifactId>
-            <scope>provided</scope>
+            <artifactId>osgi.annotation</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>osgi.core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.felix</groupId>
@@ -55,12 +57,10 @@
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.mockito</groupId>
             <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
         </dependency>
     </dependencies>
 
@@ -69,21 +69,15 @@
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
-                <extensions>true</extensions>
                 <configuration>
                     <instructions>
-                        <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
-                        <Private-Package>${pom.artifactId}</Private-Package>
-                        <Bundle-Activator>${pom.artifactId}.Activator</Bundle-Activator>
-                        <Import-Package>!org.osgi.service.log,
+                        <Import-Package>
+                            !org.osgi.service.log,
                             org.apache.felix.service.command,
-                            org.osgi.framework; version="[1.5,2.0)",
-                            org.osgi.framework.wiring; resolution:=optional, *
+                            *
                         </Import-Package>
-                        <Include-Resource>
-                            {maven-resources},META-INF/LICENSE=LICENSE,META-INF/NOTICE=NOTICE,META-INF/DEPENDENCIES=DEPENDENCIES
-                        </Include-Resource>
-                        <DynamicImport-Package>org.apache.felix.bundlerepository, org.apache.felix.bundlerepository.*, org.osgi.service.log
+                        <DynamicImport-Package>
+                            org.osgi.service.log
                         </DynamicImport-Package>
                     </instructions>
                 </configuration>

Modified: felix/trunk/gogo/command/src/main/java/org/apache/felix/gogo/command/Activator.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/command/src/main/java/org/apache/felix/gogo/command/Activator.java?rev=1849343&r1=1849342&r2=1849343&view=diff
==============================================================================
--- felix/trunk/gogo/command/src/main/java/org/apache/felix/gogo/command/Activator.java (original)
+++ felix/trunk/gogo/command/src/main/java/org/apache/felix/gogo/command/Activator.java Wed Dec 19 22:29:51 2018
@@ -19,9 +19,13 @@
 package org.apache.felix.gogo.command;
 
 import java.util.Hashtable;
+
+import org.osgi.annotation.bundle.Header;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
 
+@Header(name = Constants.BUNDLE_ACTIVATOR, value = "${@class}")
 public class Activator implements BundleActivator
 {
     public void start(BundleContext bc) {

Added: felix/trunk/gogo/command/src/main/java/org/apache/felix/gogo/command/package-info.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/command/src/main/java/org/apache/felix/gogo/command/package-info.java?rev=1849343&view=auto
==============================================================================
--- felix/trunk/gogo/command/src/main/java/org/apache/felix/gogo/command/package-info.java (added)
+++ felix/trunk/gogo/command/src/main/java/org/apache/felix/gogo/command/package-info.java Wed Dec 19 22:29:51 2018
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+@org.osgi.annotation.bundle.Capability(
+    namespace = "org.apache.felix.gogo",
+    name = "command.implementation"
+)
+@org.osgi.annotation.bundle.Requirement(
+    effective = "active",
+    namespace = "org.apache.felix.gogo",
+    name = "runtime.implementation"
+)
+package org.apache.felix.gogo.command;
+

Modified: felix/trunk/gogo/gogo-parent/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/gogo-parent/pom.xml?rev=1849343&r1=1849342&r2=1849343&view=diff
==============================================================================
--- felix/trunk/gogo/gogo-parent/pom.xml (original)
+++ felix/trunk/gogo/gogo-parent/pom.xml Wed Dec 19 22:29:51 2018
@@ -22,6 +22,7 @@
         <groupId>org.apache.felix</groupId>
         <artifactId>felix-parent</artifactId>
         <version>5</version>
+        <relativePath>../pom/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <packaging>pom</packaging>
@@ -40,13 +41,31 @@
         <dependencies>
             <dependency>
                 <groupId>org.osgi</groupId>
-                <artifactId>osgi.core</artifactId>
-                <version>6.0.0</version>
+                <artifactId>org.osgi.namespace.service</artifactId>
+                <version>1.0.0</version>
+                <scope>provided</scope>
+            </dependency>
+            <dependency>
+                <groupId>org.osgi</groupId>
+                <artifactId>org.osgi.service.event</artifactId>
+                <version>1.3.1</version>
+                <scope>provided</scope>
+            </dependency>
+            <dependency>
+                <groupId>org.osgi</groupId>
+                <artifactId>org.osgi.service.log</artifactId>
+                <version>1.3.0</version>
+                <scope>provided</scope>
+            </dependency>
+            <dependency>
+                <groupId>org.osgi</groupId>
+                <artifactId>osgi.annotation</artifactId>
+                <version>7.0.0</version>
                 <scope>provided</scope>
             </dependency>
             <dependency>
                 <groupId>org.osgi</groupId>
-                <artifactId>osgi.cmpn</artifactId>
+                <artifactId>osgi.core</artifactId>
                 <version>6.0.0</version>
                 <scope>provided</scope>
             </dependency>
@@ -74,6 +93,7 @@
     <properties>
         <animal.sniffer.skip>true</animal.sniffer.skip>
         <felix.java.version>8</felix.java.version>
+        <bnd.version>4.1.0</bnd.version>
     </properties>
 
     <build>
@@ -82,11 +102,20 @@
                 <plugin>
                     <groupId>org.apache.felix</groupId>
                     <artifactId>maven-bundle-plugin</artifactId>
-                    <version>3.5.0</version>
+                    <version>4.1.0</version>
                     <extensions>true</extensions>
+                    <configuration>
+                        <obrRepository>NONE</obrRepository>
+                        <instructions>
+                            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+                            <Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
+                            <Include-Resource>{maven-resources},META-INF/LICENSE=LICENSE,META-INF/NOTICE=NOTICE,META-INF/DEPENDENCIES=DEPENDENCIES</Include-Resource>
+                            <_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>
+                            <_removeheaders>Private-Package,Ignore-Package,Include-Resource</_removeheaders>
+                        </instructions>
+                    </configuration>
                 </plugin>
             </plugins>
         </pluginManagement>
     </build>
-
 </project>

Modified: felix/trunk/gogo/jline/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/jline/pom.xml?rev=1849343&r1=1849342&r2=1849343&view=diff
==============================================================================
--- felix/trunk/gogo/jline/pom.xml (original)
+++ felix/trunk/gogo/jline/pom.xml Wed Dec 19 22:29:51 2018
@@ -20,7 +20,7 @@
     <parent>
         <groupId>org.apache.felix</groupId>
         <artifactId>gogo-parent</artifactId>
-        <version>4</version>
+        <version>5-SNAPSHOT</version>
         <relativePath>../gogo-parent/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
@@ -36,13 +36,11 @@
     <dependencies>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>osgi.core</artifactId>
-            <scope>provided</scope>
+            <artifactId>osgi.annotation</artifactId>
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>osgi.cmpn</artifactId>
-            <scope>provided</scope>
+            <artifactId>osgi.core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.felix</groupId>
@@ -64,12 +62,10 @@
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.mockito</groupId>
             <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
         </dependency>
     </dependencies>
     <build>
@@ -77,7 +73,6 @@
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
-                <extensions>true</extensions>
                 <configuration>
                     <instructions>
                         <Export-Package>
@@ -85,16 +80,9 @@
                         </Export-Package>
                         <Import-Package>
                             !org.apache.felix.gogo.runtime.threadio,
-                            org.apache.felix.service.*;version="[1.0,2.0)",
                             org.jline*;version="[3.0,4)",
                             *
                         </Import-Package>
-                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
-                        <Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
-                        <Bundle-Activator>org.apache.felix.gogo.jline.Activator</Bundle-Activator>
-                        <Include-Resource>{maven-resources},META-INF/LICENSE=LICENSE,META-INF/NOTICE=NOTICE,META-INF/DEPENDENCIES=DEPENDENCIES</Include-Resource>
-                        <_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>
-                        <_removeheaders>Private-Package,Ignore-Package,Include-Resource</_removeheaders>
                     </instructions>
                 </configuration>
             </plugin>

Modified: felix/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/Activator.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/Activator.java?rev=1849343&r1=1849342&r2=1849343&view=diff
==============================================================================
--- felix/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/Activator.java (original)
+++ felix/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/Activator.java Wed Dec 19 22:29:51 2018
@@ -37,10 +37,13 @@ import org.apache.felix.service.command.
 import org.apache.felix.service.command.Converter;
 import org.jline.terminal.Terminal;
 import org.jline.terminal.TerminalBuilder;
+import org.osgi.annotation.bundle.Header;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceRegistration;
 
+@Header(name = Constants.BUNDLE_ACTIVATOR, value = "${@class}")
 public class Activator implements BundleActivator, SingleServiceListener {
     private final Set<ServiceRegistration<?>> regs = new HashSet<>();
     private BundleContext context;

Added: felix/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/package-info.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/package-info.java?rev=1849343&view=auto
==============================================================================
--- felix/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/package-info.java (added)
+++ felix/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/package-info.java Wed Dec 19 22:29:51 2018
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+
+@org.osgi.annotation.bundle.Capability(
+    attribute = "implementation.name=gogo.jline",
+    namespace = "org.apache.felix.gogo",
+    name = "shell.implementation"
+)
+@Requirement(
+    effective = "active",
+    namespace = "org.apache.felix.gogo",
+    name = "command.implementation"
+)
+package org.apache.felix.gogo.jline;
+
+import org.osgi.annotation.bundle.Requirement;

Modified: felix/trunk/gogo/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/pom.xml?rev=1849343&r1=1849342&r2=1849343&view=diff
==============================================================================
--- felix/trunk/gogo/pom.xml (original)
+++ felix/trunk/gogo/pom.xml Wed Dec 19 22:29:51 2018
@@ -18,15 +18,12 @@
  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/maven-v4_0_0.xsd">
-    <parent>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>felix-parent</artifactId>
-        <version>5</version>
-    </parent>
+
     <modelVersion>4.0.0</modelVersion>
     <packaging>pom</packaging>
     <name>Apache Felix Gogo</name>
     <description>Apache Felix Gogo Subproject</description>
+    <groupId>org.apache.felix</groupId>
     <artifactId>gogo-reactor</artifactId>
     <version>1.1.0-SNAPSHOT</version>
 
@@ -37,7 +34,7 @@
     </scm>
 
     <modules>
-    	<module>gogo-parent</module>
+        <module>gogo-parent</module>
         <module>runtime</module>
         <module>jline</module>
         <module>shell</module>

Modified: felix/trunk/gogo/runtime/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/runtime/pom.xml?rev=1849343&r1=1849342&r2=1849343&view=diff
==============================================================================
--- felix/trunk/gogo/runtime/pom.xml (original)
+++ felix/trunk/gogo/runtime/pom.xml Wed Dec 19 22:29:51 2018
@@ -20,7 +20,7 @@
     <parent>
         <groupId>org.apache.felix</groupId>
         <artifactId>gogo-parent</artifactId>
-        <version>4</version>
+        <version>5-SNAPSHOT</version>
         <relativePath>../gogo-parent/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
@@ -36,23 +36,27 @@
     <dependencies>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>osgi.core</artifactId>
-            <scope>provided</scope>
+            <artifactId>org.osgi.namespace.service</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.service.event</artifactId>
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>osgi.cmpn</artifactId>
-            <scope>provided</scope>
+            <artifactId>osgi.annotation</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>osgi.core</artifactId>
         </dependency>
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.mockito</groupId>
             <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
         </dependency>
     </dependencies>
     <build>
@@ -60,13 +64,8 @@
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
-                <extensions>true</extensions>
                 <configuration>
                     <instructions>
-                        <Provide-Capability>
-                            osgi.service; effective:=active; objectClass="org.apache.felix.service.threadio.ThreadIO",
-                            osgi.service; effective:=active; objectClass="org.apache.felix.service.command.CommandProcessor"
-                        </Provide-Capability>
                         <Export-Package>
                             org.apache.felix.service.command; version=1.0.0,
                             org.apache.felix.service.threadio; version=1.0.0,
@@ -74,17 +73,8 @@
                         </Export-Package>
                         <Import-Package>
                             org.osgi.service.event*; resolution:=optional,
-                            org.osgi.service.log*; resolution:=optional,
-                            org.osgi.service.packageadmin*; resolution:=optional,
-                            org.osgi.service.startlevel*; resolution:=optional,
                             *
                         </Import-Package>
-                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
-                        <Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
-                        <Bundle-Activator>org.apache.felix.gogo.runtime.activator.Activator</Bundle-Activator>
-                        <Include-Resource>{maven-resources},META-INF/LICENSE=LICENSE,META-INF/NOTICE=NOTICE,META-INF/DEPENDENCIES=DEPENDENCIES</Include-Resource>
-                        <_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>
-                        <_removeheaders>Private-Package,Ignore-Package,Include-Resource</_removeheaders>
                     </instructions>
                 </configuration>
             </plugin>

Modified: felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/CommandProcessorImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/CommandProcessorImpl.java?rev=1849343&r1=1849342&r2=1849343&view=diff
==============================================================================
--- felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/CommandProcessorImpl.java (original)
+++ felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/CommandProcessorImpl.java Wed Dec 19 22:29:51 2018
@@ -36,7 +36,14 @@ import java.util.concurrent.CopyOnWriteA
 
 import org.apache.felix.service.command.*;
 import org.apache.felix.service.threadio.ThreadIO;
+import org.osgi.annotation.bundle.Capability;
+import org.osgi.namespace.service.ServiceNamespace;
 
+@Capability(
+    namespace = ServiceNamespace.SERVICE_NAMESPACE,
+    attribute = "objectClass='org.apache.felix.service.command.CommandProcessor'",
+    effective = "active"
+)
 public class CommandProcessorImpl implements CommandProcessor
 {
     protected final Set<Converter> converters = new CopyOnWriteArraySet<>();

Modified: felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/activator/Activator.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/activator/Activator.java?rev=1849343&r1=1849342&r2=1849343&view=diff
==============================================================================
--- felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/activator/Activator.java (original)
+++ felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/activator/Activator.java Wed Dec 19 22:29:51 2018
@@ -32,6 +32,7 @@ import org.apache.felix.service.command.
 import org.apache.felix.service.command.CommandProcessor;
 import org.apache.felix.service.command.Converter;
 import org.apache.felix.service.threadio.ThreadIO;
+import org.osgi.annotation.bundle.Header;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
@@ -41,6 +42,7 @@ import org.osgi.framework.ServiceReferen
 import org.osgi.framework.ServiceRegistration;
 import org.osgi.util.tracker.ServiceTracker;
 
+@Header(name = Constants.BUNDLE_ACTIVATOR, value = "${@class}")
 public class Activator implements BundleActivator
 {
     protected CommandProcessorImpl processor;

Added: felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/package-info.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/package-info.java?rev=1849343&view=auto
==============================================================================
--- felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/package-info.java (added)
+++ felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/package-info.java Wed Dec 19 22:29:51 2018
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+@org.osgi.annotation.bundle.Capability(
+    namespace = "org.apache.felix.gogo",
+    name = "runtime.implementation"
+)
+@org.osgi.annotation.bundle.Requirement(
+    effective = "active",
+    namespace = "org.apache.felix.gogo",
+    name = "shell.implementation"
+)
+package org.apache.felix.gogo.runtime;
+

Modified: felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/threadio/ThreadIOImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/threadio/ThreadIOImpl.java?rev=1849343&r1=1849342&r2=1849343&view=diff
==============================================================================
--- felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/threadio/ThreadIOImpl.java (original)
+++ felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/threadio/ThreadIOImpl.java Wed Dec 19 22:29:51 2018
@@ -24,7 +24,14 @@ import java.io.PrintStream;
 import java.util.logging.Logger;
 
 import org.apache.felix.service.threadio.ThreadIO;
+import org.osgi.annotation.bundle.Capability;
+import org.osgi.namespace.service.ServiceNamespace;
 
+@Capability(
+    namespace = ServiceNamespace.SERVICE_NAMESPACE,
+    attribute = "objectClass='org.apache.felix.service.threadio.ThreadIO'",
+    effective = "active"
+)
 public class ThreadIOImpl implements ThreadIO
 {
     static private final Logger log = Logger.getLogger(ThreadIOImpl.class.getName());

Added: felix/trunk/gogo/runtime/src/main/java/org/apache/felix/service/command/annotation/RequireGogo.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/runtime/src/main/java/org/apache/felix/service/command/annotation/RequireGogo.java?rev=1849343&view=auto
==============================================================================
--- felix/trunk/gogo/runtime/src/main/java/org/apache/felix/service/command/annotation/RequireGogo.java (added)
+++ felix/trunk/gogo/runtime/src/main/java/org/apache/felix/service/command/annotation/RequireGogo.java Wed Dec 19 22:29:51 2018
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+
+package org.apache.felix.service.command.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import org.osgi.annotation.bundle.Attribute;
+import org.osgi.annotation.bundle.Requirement;
+
+import static java.lang.annotation.RetentionPolicy.CLASS;
+
+import java.lang.annotation.Documented;
+
+import static java.lang.annotation.ElementType.*;
+
+@Documented
+@Retention(CLASS)
+@Target({TYPE, PACKAGE})
+@Requirement(
+    effective = "active",
+    namespace = "org.apache.felix.gogo",
+    name = "shell.implementation"
+)
+public @interface RequireGogo {
+    String JLINE = "gogo.jline";
+    String SHELL = "gogo.shell";
+
+    @Attribute("implementation.name")
+    String value() default SHELL;
+}

Modified: felix/trunk/gogo/shell/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/shell/pom.xml?rev=1849343&r1=1849342&r2=1849343&view=diff
==============================================================================
--- felix/trunk/gogo/shell/pom.xml (original)
+++ felix/trunk/gogo/shell/pom.xml Wed Dec 19 22:29:51 2018
@@ -1,101 +1,80 @@
-<!-- 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. -->
+<!-- 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/maven-v4_0_0.xsd">
-	<parent>
-		<groupId>org.apache.felix</groupId>
-		<artifactId>gogo-parent</artifactId>
-		<version>4</version>
-		<relativePath>../gogo-parent/pom.xml</relativePath>
-	</parent>
-	<modelVersion>4.0.0</modelVersion>
-	<packaging>bundle</packaging>
-	<name>Apache Felix Gogo Shell</name>
-	<artifactId>org.apache.felix.gogo.shell</artifactId>
-	<version>1.1.1-SNAPSHOT</version>
+    <parent>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>gogo-parent</artifactId>
+        <version>5-SNAPSHOT</version>
+        <relativePath>../gogo-parent/pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>bundle</packaging>
+    <name>Apache Felix Gogo Shell</name>
+    <artifactId>org.apache.felix.gogo.shell</artifactId>
+    <version>1.1.1-SNAPSHOT</version>
     <scm>
         <connection>scm:svn:http://svn.apache.org/repos/asf/felix/trunk/gogo/shell</connection>
         <developerConnection>scm:svn:https://svn.apache.org/repos/asf/felix/trunk/gogo/shell</developerConnection>
         <url>http://svn.apache.org/repos/asf/felix/gogo/shell</url>
     </scm>
-	<dependencies>
-		<dependency>
-			<groupId>org.osgi</groupId>
-			<artifactId>osgi.core</artifactId>
-			<scope>provided</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.osgi</groupId>
-			<artifactId>osgi.cmpn</artifactId>
-			<scope>provided</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.felix</groupId>
-			<artifactId>org.apache.felix.gogo.runtime</artifactId>
-			<version>1.1.1-SNAPSHOT</version>
-		</dependency>
-		<dependency>
-			<groupId>junit</groupId>
-			<artifactId>junit</artifactId>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.mockito</groupId>
-			<artifactId>mockito-core</artifactId>
-			<scope>test</scope>
-		</dependency>
-	</dependencies>
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.apache.felix</groupId>
-				<artifactId>maven-bundle-plugin</artifactId>
-				<extensions>true</extensions>
-				<configuration>
-					<instructions>
-						<Export-Package>
-						</Export-Package>
-						<Import-Package>
-							org.apache.felix.service.command,
-							*
-						</Import-Package>
-						<Private-Package>
-							org.apache.felix.gogo.shell,
-							org.apache.felix.gogo.options
-						</Private-Package>
-						<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
-						<Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
-						<Bundle-Activator>org.apache.felix.gogo.shell.Activator</Bundle-Activator>
-						<Include-Resource>{maven-resources},META-INF/LICENSE=LICENSE,META-INF/NOTICE=NOTICE,META-INF/DEPENDENCIES=DEPENDENCIES</Include-Resource>
-						<_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>
-						<_removeheaders>Private-Package,Ignore-Package,Include-Resource</_removeheaders>
-					</instructions>
-				</configuration>
-			</plugin>
-			<plugin>
-				<groupId>org.apache.rat</groupId>
-				<artifactId>apache-rat-plugin</artifactId>
-				<configuration>
-					<excludeSubProjects>false</excludeSubProjects>
-					<useEclipseDefaultExcludes>true</useEclipseDefaultExcludes>
-					<useMavenDefaultExcludes>true</useMavenDefaultExcludes>
-					<excludes>
-						<param>doc/*</param>
-						<param>maven-eclipse.xml</param>
-						<param>.checkstyle</param>
-						<param>.externalToolBuilders/*</param>
-						<param>src/main/resources/gosh_profile</param>
-						<param>src/main/resources/motd</param>
-					</excludes>
-				</configuration>
-			</plugin>
-		</plugins>
-	</build>
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>osgi.annotation</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>osgi.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.gogo.runtime</artifactId>
+            <version>1.1.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                    <instructions>
+                        <Export-Package></Export-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.rat</groupId>
+                <artifactId>apache-rat-plugin</artifactId>
+                <configuration>
+                    <excludeSubProjects>false</excludeSubProjects>
+                    <useEclipseDefaultExcludes>true</useEclipseDefaultExcludes>
+                    <useMavenDefaultExcludes>true</useMavenDefaultExcludes>
+                    <excludes>
+                        <param>doc/*</param>
+                        <param>maven-eclipse.xml</param>
+                        <param>.checkstyle</param>
+                        <param>.externalToolBuilders/*</param>
+                        <param>src/main/resources/motd</param>
+                    </excludes>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>

Modified: felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Activator.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Activator.java?rev=1849343&r1=1849342&r2=1849343&view=diff
==============================================================================
--- felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Activator.java (original)
+++ felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Activator.java Wed Dec 19 22:29:51 2018
@@ -34,12 +34,15 @@ import java.util.concurrent.TimeUnit;
 import org.apache.felix.service.command.CommandProcessor;
 import org.apache.felix.service.command.CommandSession;
 import org.apache.felix.service.command.Converter;
+import org.osgi.annotation.bundle.Header;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.ServiceRegistration;
 import org.osgi.util.tracker.ServiceTracker;
 
+@Header(name = Constants.BUNDLE_ACTIVATOR, value = "${@class}")
 public class Activator implements BundleActivator
 {
     private BundleContext context;

Added: felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/package-info.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/package-info.java?rev=1849343&view=auto
==============================================================================
--- felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/package-info.java (added)
+++ felix/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/package-info.java Wed Dec 19 22:29:51 2018
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+
+@org.osgi.annotation.bundle.Capability(
+    attribute = "implementation.name=gogo.shell",
+    namespace = "org.apache.felix.gogo",
+    name = "shell.implementation"
+)
+@Requirement(
+    effective = "active",
+    namespace = "org.apache.felix.gogo",
+    name = "command.implementation"
+)
+package org.apache.felix.gogo.shell;
+
+import org.osgi.annotation.bundle.Requirement;

Modified: felix/trunk/gogo/shell/src/main/resources/gosh_profile
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/shell/src/main/resources/gosh_profile?rev=1849343&r1=1849342&r2=1849343&view=diff
==============================================================================
--- felix/trunk/gogo/shell/src/main/resources/gosh_profile (original)
+++ felix/trunk/gogo/shell/src/main/resources/gosh_profile Wed Dec 19 22:29:51 2018
@@ -1,3 +1,21 @@
+#
+# 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.
+#
 # default gosh_profile
 # only read if etc/gosh_profile doesn't exist relative to the System property
 # gosh.home or failing that the current directory.