Author: cziegeler
Date: Tue Dec  5 06:24:46 2017
New Revision: 1817153

URL: http://svn.apache.org/viewvc?rev=1817153&view=rev
Log:
FELIX-5755 : Servlet API should be optional
FELIX-5756 : Update project to latest parent pom

Modified:
    felix/trunk/inventory/changelog.txt
    felix/trunk/inventory/pom.xml
    felix/trunk/inventory/src/main/appended-resources/META-INF/DEPENDENCIES
    
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/InventoryPrinter.java
    
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/ZipAttachmentProvider.java
    
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/Activator.java
    
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterAdapter.java
    
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/WebConsolePlugin.java
    
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/package-info.java

Modified: felix/trunk/inventory/changelog.txt
URL: 
http://svn.apache.org/viewvc/felix/trunk/inventory/changelog.txt?rev=1817153&r1=1817152&r2=1817153&view=diff
==============================================================================
--- felix/trunk/inventory/changelog.txt (original)
+++ felix/trunk/inventory/changelog.txt Tue Dec  5 06:24:46 2017
@@ -1,3 +1,11 @@
+Changes in 1.0.6
+----------------
+** Bug
+    * [FELIX-5755] - Servlet API should be optional
+** Task
+    * [FELIX-5756] - Update project to latest parent pom
+
+
 Changes in 1.0.4
 ----------------
 ** Bug

Modified: felix/trunk/inventory/pom.xml
URL: 
http://svn.apache.org/viewvc/felix/trunk/inventory/pom.xml?rev=1817153&r1=1817152&r2=1817153&view=diff
==============================================================================
--- felix/trunk/inventory/pom.xml (original)
+++ felix/trunk/inventory/pom.xml Tue Dec  5 06:24:46 2017
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.felix</groupId>
         <artifactId>felix-parent</artifactId>
-        <version>2.1</version>
+        <version>4</version>
         <relativePath>../pom/pom.xml</relativePath>
     </parent>
 
@@ -41,36 +41,6 @@
 
     <build>
         <plugins>
-            <!-- Make sure to not use non Java 1.4 API -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <source>1.4</source>
-                    <target>1.4</target>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>animal-sniffer-maven-plugin</artifactId>
-                <version>1.7</version>
-                <configuration>
-                    <signature>
-                        <groupId>org.codehaus.mojo.signature</groupId>
-                        <artifactId>java14</artifactId>
-                        <version>1.0</version>
-                    </signature>
-                </configuration>
-                <executions>
-                    <execution>
-                        <phase>test</phase>
-                        <goals>
-                            <goal>check</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        
             <plugin>
                 <artifactId>maven-javadoc-plugin</artifactId>
                 <configuration>
@@ -82,7 +52,7 @@
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
-                <version>2.3.7</version>
+                <version>3.3.0</version>
                 <extensions>true</extensions>
                     <configuration>
                     <instructions>
@@ -93,8 +63,13 @@
                         <Bundle-Activator>
                             org.apache.felix.inventory.impl.Activator
                         </Bundle-Activator>
+                        <Import-Package>
+                            javax.servlet;resolution:=optional,
+                            javax.servlet.http;resolution:=optional,
+                            *
+                        </Import-Package>
                         <Export-Package>
-                            org.apache.felix.inventory;version=1.0.0
+                            org.apache.felix.inventory
                         </Export-Package>
                         <DynamicImport-Package>
                             javax.servlet, javax.servlet.http
@@ -108,14 +83,20 @@
     <dependencies>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
-            <version>4.2.0</version>
+            <artifactId>osgi.annotation</artifactId>
+            <version>6.0.1</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>osgi.core</artifactId>
+            <version>6.0.0</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.compendium</artifactId>
-            <version>4.2.0</version>
+            <artifactId>org.osgi.service.log</artifactId>
+            <version>1.3.0</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
@@ -127,8 +108,6 @@
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <version>4.10</version>
-            <scope>test</scope>
         </dependency>
     </dependencies>
 </project>

Modified: 
felix/trunk/inventory/src/main/appended-resources/META-INF/DEPENDENCIES
URL: 
http://svn.apache.org/viewvc/felix/trunk/inventory/src/main/appended-resources/META-INF/DEPENDENCIES?rev=1817153&r1=1817152&r2=1817153&view=diff
==============================================================================
--- felix/trunk/inventory/src/main/appended-resources/META-INF/DEPENDENCIES 
(original)
+++ felix/trunk/inventory/src/main/appended-resources/META-INF/DEPENDENCIES Tue 
Dec  5 06:24:46 2017
@@ -9,7 +9,7 @@ II. Used Third-Party Software
 
 This product uses software developed at
 The OSGi Alliance (http://www.osgi.org/).
-Copyright (c) OSGi Alliance (2000, 2009).
+Copyright (c) OSGi Alliance (2000, 2015).
 Licensed under the Apache License 2.0.
 
 

Modified: 
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/InventoryPrinter.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/inventory/src/main/java/org/apache/felix/inventory/InventoryPrinter.java?rev=1817153&r1=1817152&r2=1817153&view=diff
==============================================================================
--- 
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/InventoryPrinter.java
 (original)
+++ 
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/InventoryPrinter.java
 Tue Dec  5 06:24:46 2017
@@ -20,6 +20,8 @@ package org.apache.felix.inventory;
 
 import java.io.PrintWriter;
 
+import org.osgi.annotation.versioning.ConsumerType;
+
 /**
  * The <code>InventoryPrinter</code> is a service interface to be
  * implemented by providers which want to hook into the display of the
@@ -34,6 +36,7 @@ import java.io.PrintWriter;
  * <li>{@link #WEBCONSOLE} - whether to confine the printer to the Web 
Console</li>
  * </ul>
  */
+@ConsumerType
 public interface InventoryPrinter
 {
 

Modified: 
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/ZipAttachmentProvider.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/inventory/src/main/java/org/apache/felix/inventory/ZipAttachmentProvider.java?rev=1817153&r1=1817152&r2=1817153&view=diff
==============================================================================
--- 
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/ZipAttachmentProvider.java
 (original)
+++ 
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/ZipAttachmentProvider.java
 Tue Dec  5 06:24:46 2017
@@ -21,6 +21,8 @@ package org.apache.felix.inventory;
 import java.io.IOException;
 import java.util.zip.ZipOutputStream;
 
+import org.osgi.annotation.versioning.ConsumerType;
+
 /**
  * This is an optional extension of the {@link InventoryPrinter}.
  * If a inventory printer implements this interface, the printer
@@ -32,6 +34,7 @@ import java.util.zip.ZipOutputStream;
  * When writing output to a ZIP file, this method is called if the
  * {@link InventoryPrinter} service implements this interface.
  */
+@ConsumerType
 public interface ZipAttachmentProvider
 {
 

Modified: 
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/Activator.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/Activator.java?rev=1817153&r1=1817152&r2=1817153&view=diff
==============================================================================
--- 
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/Activator.java
 (original)
+++ 
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/Activator.java
 Tue Dec  5 06:24:46 2017
@@ -5,9 +5,9 @@
  * 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.
@@ -44,12 +44,14 @@ public class Activator implements Bundle
     {
         this.logServiceTracker = new ServiceTracker(context, 
"org.osgi.service.log.LogService", null)
         {
+            @Override
             public Object addingService(ServiceReference reference)
             {
                 Activator.logService = super.addingService(reference);
                 return Activator.logService;
             }
 
+            @Override
             public void removedService(ServiceReference reference, Object 
service)
             {
                 Activator.logService = null;
@@ -114,7 +116,7 @@ public class Activator implements Bundle
                     code = "*DEBUG*";
             }
 
-            System.err.println(code + " " + message);
+            System.out.println(code + " " + message);
             if (exception != null)
             {
                 exception.printStackTrace(System.out);

Modified: 
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterAdapter.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterAdapter.java?rev=1817153&r1=1817152&r2=1817153&view=diff
==============================================================================
--- 
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterAdapter.java
 (original)
+++ 
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterAdapter.java
 Tue Dec  5 06:24:46 2017
@@ -19,12 +19,17 @@ package org.apache.felix.inventory.impl;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.util.Comparator;
+import java.util.Dictionary;
+import java.util.Hashtable;
 import java.util.zip.ZipOutputStream;
 
-import org.apache.felix.inventory.InventoryPrinter;
 import org.apache.felix.inventory.Format;
+import org.apache.felix.inventory.InventoryPrinter;
 import org.apache.felix.inventory.ZipAttachmentProvider;
+import org.apache.felix.inventory.impl.webconsole.ConsoleConstants;
+import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceFactory;
 import org.osgi.framework.ServiceRegistration;
 
 /**
@@ -72,7 +77,24 @@ public class InventoryPrinterAdapter imp
             final Object value = 
this.description.getServiceReference().getProperty(InventoryPrinter.WEBCONSOLE);
             if (value == null || !"false".equalsIgnoreCase(value.toString()))
             {
-                this.registration = WebConsolePlugin.register(context, 
manager, this.description);
+                final Dictionary props = new Hashtable();
+                props.put(ConsoleConstants.PLUGIN_LABEL, "status-" + 
this.description.getName());
+                props.put(ConsoleConstants.PLUGIN_TITLE, 
this.description.getTitle());
+                props.put(ConsoleConstants.PLUGIN_CATEGORY, 
ConsoleConstants.WEB_CONSOLE_CATEGORY);
+                this.registration = 
context.registerService(ConsoleConstants.INTERFACE_SERVLET, new ServiceFactory()
+                {
+
+                    public void ungetService(final Bundle bundle, final 
ServiceRegistration registration, final Object service)
+                    {
+                        // nothing to do
+                    }
+
+                    public Object getService(final Bundle bundle, final 
ServiceRegistration registration)
+                    {
+                        return new WebConsolePlugin(manager, 
description.getName());
+                    }
+
+                }, props);
             }
         }
     }

Modified: 
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/WebConsolePlugin.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/WebConsolePlugin.java?rev=1817153&r1=1817152&r2=1817153&view=diff
==============================================================================
--- 
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/WebConsolePlugin.java
 (original)
+++ 
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/impl/WebConsolePlugin.java
 Tue Dec  5 06:24:46 2017
@@ -5,9 +5,9 @@
  * 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.
@@ -16,15 +16,6 @@
  */
 package org.apache.felix.inventory.impl;
 
-import java.util.Dictionary;
-import java.util.Hashtable;
-
-import org.apache.felix.inventory.impl.webconsole.ConsoleConstants;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceFactory;
-import org.osgi.framework.ServiceRegistration;
-
 /**
  * The web console plugin for a inventory printer.
  */
@@ -38,7 +29,7 @@ public class WebConsolePlugin extends Ab
 
     /**
      * Constructor
-     * 
+     *
      * @param inventoryPrinterManager The inventory printer manager.
      * @param printerName The name of the printer this plugin is displaying.
      */
@@ -52,28 +43,4 @@ public class WebConsolePlugin extends Ab
     {
         return this.inventoryPrinterManager.getHandler(this.printerName);
     }
-
-    public static ServiceRegistration register(final BundleContext context, 
final InventoryPrinterManagerImpl manager,
-        final InventoryPrinterDescription desc)
-    {
-        final Dictionary props = new Hashtable();
-        props.put(ConsoleConstants.PLUGIN_LABEL, "status-" + desc.getName());
-        props.put(ConsoleConstants.PLUGIN_TITLE, desc.getTitle());
-        props.put(ConsoleConstants.PLUGIN_CATEGORY, 
ConsoleConstants.WEB_CONSOLE_CATEGORY);
-        return context.registerService(ConsoleConstants.INTERFACE_SERVLET, new 
ServiceFactory()
-        {
-
-            public void ungetService(final Bundle bundle, final 
ServiceRegistration registration, final Object service)
-            {
-                // nothing to do
-            }
-
-            public Object getService(final Bundle bundle, final 
ServiceRegistration registration)
-            {
-                return new WebConsolePlugin(manager, desc.getName());
-            }
-
-        }, props);
-
-    }
 }
\ No newline at end of file

Modified: 
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/package-info.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/inventory/src/main/java/org/apache/felix/inventory/package-info.java?rev=1817153&r1=1817152&r2=1817153&view=diff
==============================================================================
--- 
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/package-info.java
 (original)
+++ 
felix/trunk/inventory/src/main/java/org/apache/felix/inventory/package-info.java
 Tue Dec  5 06:24:46 2017
@@ -24,4 +24,5 @@
  * @see <a 
href="http://felix.apache.org/documentation/subprojects/apache-felix-inventory.html";>Apache
 Felix Inventory</a>
  * @version 1.0
  */
+@org.osgi.annotation.versioning.Version("1.0")
 package org.apache.felix.inventory;
\ No newline at end of file


Reply via email to