Remove start-ds as it already works with the main starter
authorChristian Schneider <chris@die-schneider.net>
Mon, 25 Apr 2016 10:35:52 +0000 (12:35 +0200)
committerChristian Schneider <chris@die-schneider.net>
Mon, 25 Apr 2016 10:35:52 +0000 (12:35 +0200)
samples/ds/service-consumer/pom.xml
samples/ds/service-provider/pom.xml
starters/karaf-boot-starter-ds/pom.xml [deleted file]
starters/karaf-boot-starter-ds/src/main/java/org/apache/karaf/boot/ds/impl/DsProcessor.java [deleted file]
starters/karaf-boot-starter-ds/src/main/resources/META-INF/services/javax.annotation.processing.Processor [deleted file]
starters/karaf-boot-starter/pom.xml
starters/pom.xml

index c6b85c0..3048e77 100644 (file)
@@ -28,7 +28,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.karaf.boot</groupId>
-            <artifactId>karaf-boot-starter-ds</artifactId>
+            <artifactId>karaf-boot-starter</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
index 854a780..3340b34 100644 (file)
@@ -28,7 +28,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.karaf.boot</groupId>
-            <artifactId>karaf-boot-starter-ds</artifactId>
+            <artifactId>karaf-boot-starter</artifactId>
             <version>${project.version}</version>
         </dependency>
     </dependencies>
diff --git a/starters/karaf-boot-starter-ds/pom.xml b/starters/karaf-boot-starter-ds/pom.xml
deleted file mode 100644 (file)
index 331c8e2..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<?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.boot</groupId>
-        <artifactId>karaf-boot-starters</artifactId>
-        <version>1.0.0-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-
-    <artifactId>karaf-boot-starter-ds</artifactId>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>osgi.cmpn</artifactId>
-            <version>${osgi.version}</version>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <compilerArgument>-proc:none</compilerArgument>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
-</project>
\ No newline at end of file
diff --git a/starters/karaf-boot-starter-ds/src/main/java/org/apache/karaf/boot/ds/impl/DsProcessor.java b/starters/karaf-boot-starter-ds/src/main/java/org/apache/karaf/boot/ds/impl/DsProcessor.java
deleted file mode 100644 (file)
index 49baa70..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-package org.apache.karaf.boot.ds.impl;
-
-import javax.annotation.processing.AbstractProcessor;
-import javax.annotation.processing.RoundEnvironment;
-import javax.lang.model.element.TypeElement;
-import javax.tools.Diagnostic.Kind;
-import javax.tools.FileObject;
-import javax.tools.StandardLocation;
-import java.io.CharArrayWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.Reader;
-import java.io.Writer;
-import java.util.HashSet;
-import java.util.Set;
-
-public class DsProcessor extends AbstractProcessor {
-
-    boolean hasRun;
-
-    public DsProcessor() {
-    }
-
-    @Override
-    public Set<String> getSupportedAnnotationTypes() {
-        Set<String> set = new HashSet<String>();
-        set.add(org.osgi.service.component.annotations.Component.class.getName());
-        return set;
-    }
-
-    @Override
-    public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
-        if (!hasRun) {
-            hasRun = true;
-            // Add the Karaf embedded package
-            try (PrintWriter w = appendResource("META-INF/org.apache.karaf.boot.bnd")) {
-                w.println("_dsannotations: *");
-            } catch (Exception e) {
-                processingEnv.getMessager().printMessage(Kind.ERROR, "Error: " + e.getMessage());
-            }
-        }
-        return true;
-    }
-
-    private PrintWriter appendResource(String resource) throws IOException {
-        try {
-            FileObject o = processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT, "", resource);
-            return new PrintWriter(o.openWriter());
-        } catch (Exception e) {
-            try {
-                FileObject o = processingEnv.getFiler().getResource(StandardLocation.CLASS_OUTPUT, "", resource);
-                CharArrayWriter baos = new CharArrayWriter();
-                try (Reader r = o.openReader(true)) {
-                    char[] buf = new char[4096];
-                    int l;
-                    while ((l = r.read(buf)) > 0) {
-                        baos.write(buf, 0, l);
-                    }
-                }
-                o.delete();
-                o = processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT, "", resource);
-                Writer w = o.openWriter();
-                w.write(baos.toCharArray());
-                return new PrintWriter(w);
-            } catch (Exception e2) {
-                e2.addSuppressed(e);
-                e2.printStackTrace();
-                throw e2;
-            }
-        }
-    }
-}
diff --git a/starters/karaf-boot-starter-ds/src/main/resources/META-INF/services/javax.annotation.processing.Processor b/starters/karaf-boot-starter-ds/src/main/resources/META-INF/services/javax.annotation.processing.Processor
deleted file mode 100644 (file)
index 11ef8af..0000000
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.karaf.boot.ds.impl.DsProcessor
index e5b2742..1c5380a 100644 (file)
             <artifactId>org.osgi.core</artifactId>
             <version>${osgi.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>osgi.cmpn</artifactId>
+            <version>${osgi.version}</version>
+        </dependency>
     </dependencies>
 
 </project>
\ No newline at end of file
index 57dbd39..9a4adf1 100644 (file)
@@ -34,7 +34,6 @@
     <modules>
         <module>karaf-boot-starter</module>
         <module>karaf-boot-starter-karaf</module>
-        <module>karaf-boot-starter-ds</module>
         <module>karaf-boot-starter-shell</module>
         <module>karaf-boot-starter-web</module>
         <module>karaf-boot-starter-jpa</module>
@@ -42,4 +41,4 @@
         <module>karaf-boot-starter-blueprint</module>
     </modules>
 
-</project>
\ No newline at end of file
+</project>