diff --git a/ipojo/bnd-ipojo-plugin/.classpath b/ipojo/bnd-ipojo-plugin/.classpath
deleted file mode 100644
index f9479ba..0000000
--- a/ipojo/bnd-ipojo-plugin/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" output="target/classes" path="src/main/java"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
-	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
-	<classpathentry kind="output" path="target/classes"/>
-</classpath>
diff --git a/ipojo/bnd-ipojo-plugin/.project b/ipojo/bnd-ipojo-plugin/.project
deleted file mode 100644
index f064da4..0000000
--- a/ipojo/bnd-ipojo-plugin/.project
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>bnd-ipojo-plugin</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.m2e.core.maven2Builder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-		<nature>org.eclipse.m2e.core.maven2Nature</nature>
-	</natures>
-</projectDescription>
diff --git a/ipojo/bnd-ipojo-plugin/.settings/org.eclipse.jdt.core.prefs b/ipojo/bnd-ipojo-plugin/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index b12d728..0000000
--- a/ipojo/bnd-ipojo-plugin/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,6 +0,0 @@
-#Sat Aug 20 14:54:18 CEST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/ipojo/bnd-ipojo-plugin/.settings/org.eclipse.m2e.core.prefs b/ipojo/bnd-ipojo-plugin/.settings/org.eclipse.m2e.core.prefs
deleted file mode 100644
index 7fe79be..0000000
--- a/ipojo/bnd-ipojo-plugin/.settings/org.eclipse.m2e.core.prefs
+++ /dev/null
@@ -1,5 +0,0 @@
-#Sat Aug 20 14:54:08 CEST 2011
-activeProfiles=
-eclipse.preferences.version=1
-resolveWorkspaceProjects=true
-version=1
diff --git a/ipojo/bnd-ipojo-plugin/pom.xml b/ipojo/bnd-ipojo-plugin/pom.xml
deleted file mode 100644
index 0473175..0000000
--- a/ipojo/bnd-ipojo-plugin/pom.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-<?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>
-    <parent>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>felix-parent</artifactId>
-        <version>1.2.1</version>
-        <relativePath>../../pom/pom.xml</relativePath>
-    </parent>
-
-    <artifactId>bnd-ipojo-plugin</artifactId>
-    <version>1.0.0-SNAPSHOT</version>
-    <name>Apache Felix iPOJO Bnd Plugin</name>
-
-    <dependencies>
-        <dependency>
-            <groupId>biz.aQute</groupId>
-            <artifactId>bndlib</artifactId>
-            <version>1.43.0</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.ipojo.manipulator</artifactId>
-            <version>1.9.0-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.ipojo.annotations</artifactId>
-            <version>1.8.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-all</artifactId>
-            <version>1.8.5</version>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <source>1.5</source>
-                    <target>1.5</target>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
-</project>
\ No newline at end of file
diff --git a/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/BndJarResourceStore.java b/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/BndJarResourceStore.java
deleted file mode 100644
index 24e1305..0000000
--- a/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/BndJarResourceStore.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * 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.ipojo.bnd;
-
-import aQute.lib.osgi.Analyzer;
-import aQute.lib.osgi.Clazz;
-import aQute.lib.osgi.Jar;
-import aQute.lib.osgi.Resource;
-import aQute.libg.reporter.Reporter;
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Handler;
-import org.apache.felix.ipojo.manipulator.Pojoization;
-import org.apache.felix.ipojo.manipulator.ResourceStore;
-import org.apache.felix.ipojo.manipulator.ResourceVisitor;
-import org.apache.felix.ipojo.manipulator.render.MetadataRenderer;
-import org.apache.felix.ipojo.manipulator.util.Metadatas;
-import org.apache.felix.ipojo.manipulator.util.Streams;
-import org.apache.felix.ipojo.metadata.Element;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.*;
-
-public class BndJarResourceStore implements ResourceStore {
-
-    private Analyzer m_analyzer;
-    private Reporter m_reporter;
-
-    private MetadataRenderer m_renderer = new MetadataRenderer();
-
-    private List<Element> m_metadata;
-
-    public BndJarResourceStore(Analyzer analyzer, Reporter reporter) {
-        m_metadata = new ArrayList<Element>();
-        m_analyzer = analyzer;
-        m_reporter = reporter;
-    }
-
-    public byte[] read(String path) throws IOException {
-        Resource resource = m_analyzer.getJar().getResource(path);
-        InputStream is = null;
-        try {
-            is = resource.openInputStream();
-        } catch (Exception e) {
-            throw new IOException("Cannot read " + path);
-        }
-        return Streams.readBytes(is);
-    }
-
-    public void accept(ResourceVisitor visitor) {
-
-        try {
-            // Only visit classes annotated with @Component or @Handler
-            String annotations = Component.class.getName() + "|" + Handler.class.getName();
-
-            Collection<Clazz> classes = m_analyzer.getClasses("",
-                    Clazz.QUERY.ANNOTATION.name(), annotations,
-                    Clazz.QUERY.NAMED.name(), "*");
-
-            // Iterates over discovered resources
-            for (Clazz clazz : classes) {
-                visitor.visit(clazz.getPath());
-            }
-        } catch (Exception e) {
-            m_reporter.error("Cannot find iPOJO annotated types: " + e.getMessage());
-        }
-    }
-
-    public void open() throws IOException {
-        // nothing to do
-    }
-
-    public void writeMetadata(Element metadata) {
-        m_metadata.add(metadata);
-
-        // Find referred packages and add them into Bnd
-        for (String referred : Metadatas.findReferredPackages(metadata)) {
-            if (m_analyzer.getReferred().get(referred) == null) {
-                // The given package is not referred ATM
-                m_analyzer.getReferred().put(referred, new HashMap<String, String>());
-            }
-        }
-
-        // IPOJO-Components will be written during the close method.
-    }
-
-    public void write(String resourcePath, byte[] resource) throws IOException {
-        Jar jar = m_analyzer.getJar();
-        jar.putResource(resourcePath, new ByteArrayResource(resource));
-    }
-
-    public void close() throws IOException {
-        // Write the iPOJO header (including manipulation metadata)
-        StringBuilder builder = new StringBuilder();
-        for (Element metadata : m_metadata) {
-            builder.append(m_renderer.render(metadata));
-        }
-
-        if (builder.length() != 0) {
-            m_analyzer.setProperty("IPOJO-Components", builder.toString());
-        }
-
-        // Add some mandatory imported packages
-        Map<String, String> version = new TreeMap<String, String>();
-        version.put("version", Pojoization.IPOJO_PACKAGE_VERSION);
-
-        if (m_analyzer.getReferred().get("org.apache.felix.ipojo") == null) {
-            m_analyzer.getReferred().put("org.apache.felix.ipojo", version);
-        }
-        if (m_analyzer.getReferred().get("org.apache.felix.ipojo.architecture") == null) {
-            m_analyzer.getReferred().put("org.apache.felix.ipojo.architecture", version);
-        }
-        if (m_analyzer.getReferred().get("org.osgi.service.cm") == null) {
-            Map<String, String> cm = new TreeMap<String, String>();
-            cm.put("version", "1.2");
-            m_analyzer.getReferred().put("org.osgi.service.cm", cm);
-        }
-        if (m_analyzer.getReferred().get("org.osgi.service.log") == null) {
-            Map<String, String> log = new TreeMap<String, String>();
-            log.put("version", "1.3");
-            m_analyzer.getReferred().put("org.osgi.service.log", log);
-        }
-
-
-    }
-}
diff --git a/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/BndReporter.java b/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/BndReporter.java
deleted file mode 100644
index 8625853..0000000
--- a/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/BndReporter.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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.ipojo.bnd;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import aQute.libg.reporter.Reporter;
-import org.apache.felix.ipojo.manipulator.reporter.EmptyReporter;
-
-/**
- * A {@code BndReporter} knows how to wrap a Bnd Reporter into an iPOJO Reporter.
- *
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public class BndReporter extends EmptyReporter {
-
-    /**
-     * Bnd reporter.
-     */
-    private Reporter m_reporter;
-
-    /**
-     * Errors which occur during the manipulation.
-     */
-    private List<String> m_errors = new ArrayList<String>();
-
-    /**
-     * Warnings which occur during the manipulation.
-     */
-    private List<String> m_warnings = new ArrayList<String>();
-
-    public BndReporter(aQute.libg.reporter.Reporter reporter) {
-        m_reporter = reporter;
-    }
-
-    public List<String> getErrors() {
-        return m_errors;
-    }
-
-    public List<String> getWarnings() {
-        return m_warnings;
-    }
-
-    @Override
-    public void trace(String message, Object... args) {
-        m_reporter.trace(message, args);
-    }
-
-    @Override
-    public void info(String message, Object... args) {
-        m_reporter.progress(message, args);
-    }
-
-    @Override
-    public void warn(String message, Object... args) {
-        m_reporter.warning(message, args);
-        m_warnings.add(String.format(message, args));
-    }
-
-    @Override
-    public void error(String message, Object... args) {
-        m_reporter.error(message, args);
-        m_errors.add(String.format(message, args));
-    }
-}
diff --git a/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/ByteArrayResource.java b/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/ByteArrayResource.java
deleted file mode 100644
index d97bc39..0000000
--- a/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/ByteArrayResource.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.ipojo.bnd;
-
-import aQute.lib.osgi.AbstractResource;
-
-/**
- * A {@code ByteArrayResource} is ...
- *
- *  @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public class ByteArrayResource extends AbstractResource {
-
-    private byte[] m_content;
-
-    public ByteArrayResource(byte[] content) {
-        super(System.currentTimeMillis());
-        m_content = content;
-    }
-
-    @Override
-    protected byte[] getBytes() throws Exception {
-        return m_content;
-    }
-}
diff --git a/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/PojoizationPlugin.java b/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/PojoizationPlugin.java
deleted file mode 100644
index ed359c6..0000000
--- a/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/PojoizationPlugin.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * 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.ipojo.bnd;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import aQute.bnd.service.AnalyzerPlugin;
-import aQute.bnd.service.Plugin;
-import aQute.lib.osgi.Analyzer;
-import aQute.lib.osgi.Resource;
-import aQute.libg.reporter.Reporter;
-import org.apache.felix.ipojo.manipulator.ManipulationVisitor;
-import org.apache.felix.ipojo.manipulator.Pojoization;
-import org.apache.felix.ipojo.manipulator.ResourceStore;
-import org.apache.felix.ipojo.manipulator.metadata.AnnotationMetadataProvider;
-import org.apache.felix.ipojo.manipulator.metadata.CacheableMetadataProvider;
-import org.apache.felix.ipojo.manipulator.metadata.CompositeMetadataProvider;
-import org.apache.felix.ipojo.manipulator.metadata.FileMetadataProvider;
-import org.apache.felix.ipojo.manipulator.visitor.check.CheckFieldConsistencyVisitor;
-import org.apache.felix.ipojo.manipulator.visitor.writer.ManipulatedResourcesWriter;
-import org.apache.felix.ipojo.metadata.Element;
-
-/**
- * A {@code BndIpojoPlugin} is ...
- *
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public class PojoizationPlugin implements Plugin, AnalyzerPlugin {
-
-    private static final String PROPERTY_METADATA = "metadata";
-    private static final String PROPERTY_USE_LOCAL_SCHEMAS = "use-local-schemas";
-
-    private static final String DEFAULT_METADATA = "META-INF/metadata.xml";
-    private static final boolean DEFAULT_USE_LOCAL_SCHEMAS = false;
-
-    private String m_metadata = DEFAULT_METADATA;
-    private boolean m_useLocalSchemas = DEFAULT_USE_LOCAL_SCHEMAS;
-
-    private Reporter m_reporter;
-
-    public void setProperties(Map<String, String> configuration) {
-
-        // Use metadata file if any
-        if (configuration.containsKey(PROPERTY_METADATA)) {
-            m_metadata = configuration.get(PROPERTY_METADATA);
-        }
-
-        // Use local schemas ?
-        if (configuration.containsKey(PROPERTY_USE_LOCAL_SCHEMAS)) {
-            m_useLocalSchemas = true;
-        }
-    }
-
-    public void setReporter(Reporter reporter) {
-        m_reporter = reporter;
-    }
-
-    public boolean analyzeJar(Analyzer analyzer) throws Exception {
-
-        long start = System.currentTimeMillis();
-
-        // Wraps the Bnd Reporter
-        BndReporter reporter = new BndReporter(this.m_reporter);
-
-        // Build ResourceStore
-        BndJarResourceStore store = new BndJarResourceStore(analyzer, this.m_reporter);
-
-        // Build MetadataProvider
-        CompositeMetadataProvider provider = new CompositeMetadataProvider(reporter);
-
-        File file = new File(m_metadata);
-        if (file.exists()) {
-            // Absolute file system resource
-            FileMetadataProvider fmp = new FileMetadataProvider(file, reporter);
-            fmp.setValidateUsingLocalSchemas(m_useLocalSchemas);
-            provider.addMetadataProvider(fmp);
-        } else {
-            // In archive resource
-            Resource resource = analyzer.getJar().getResource(m_metadata);
-            if (resource != null) {
-                ResourceMetadataProvider rmp = new ResourceMetadataProvider(resource, reporter);
-                rmp.setValidateUsingLocalSchemas(m_useLocalSchemas);
-                provider.addMetadataProvider(rmp);
-            }
-        }
-        provider.addMetadataProvider(new AnnotationMetadataProvider(store, reporter));
-
-        CacheableMetadataProvider cache = new CacheableMetadataProvider(provider);
-        if (cache.getMetadatas().isEmpty()) {
-            return false;
-        }
-
-        Pojoization pojoization = new Pojoization(reporter);
-        if (m_useLocalSchemas) {
-            pojoization.setUseLocalXSD();
-        }
-
-        pojoization.pojoization(store, cache, createVisitor(store, reporter));
-
-        int nbComponents = findElements(cache.getMetadatas(), "component").size();
-        int nbHandlers = findElements(cache.getMetadatas(), "handler").size();
-        this.m_reporter.progress("iPOJO manipulation performed performed in %s ms (%d components, %d handlers).",
-                               (System.currentTimeMillis() - start),
-                               nbComponents,
-                               nbHandlers);
-
-        // Return true if a new run should be performed after the analyze
-        return false;
-    }
-
-    private List<Element> findElements(List<Element> metadatas, String name) {
-        List<Element> found = new ArrayList<Element>();
-        for (Element element : metadatas) {
-            if (name.equalsIgnoreCase(element.getName())) {
-                found.add(element);
-            }
-        }
-        return found;
-    }
-
-    private ManipulationVisitor createVisitor(ResourceStore store, BndReporter reporter) {
-        ManipulatedResourcesWriter writer = new ManipulatedResourcesWriter();
-        writer.setReporter(reporter);
-        writer.setResourceStore(store);
-
-        CheckFieldConsistencyVisitor checkFieldConsistencyVisitor = new CheckFieldConsistencyVisitor(writer);
-        checkFieldConsistencyVisitor.setReporter(reporter);
-        return checkFieldConsistencyVisitor;
-
-    }
-
-}
diff --git a/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/ResourceMetadataProvider.java b/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/ResourceMetadataProvider.java
deleted file mode 100644
index f40e681..0000000
--- a/ipojo/bnd-ipojo-plugin/src/main/java/org/apache/felix/ipojo/bnd/ResourceMetadataProvider.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * 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.ipojo.bnd;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import aQute.lib.osgi.Resource;
-import org.apache.felix.ipojo.manipulator.MetadataProvider;
-import org.apache.felix.ipojo.manipulator.Reporter;
-import org.apache.felix.ipojo.manipulator.metadata.StreamMetadataProvider;
-import org.apache.felix.ipojo.metadata.Element;
-
-/**
- * A {@code ResourceMetadataProvider} is ...
- *
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public class ResourceMetadataProvider implements MetadataProvider {
-
-    private Resource m_resource;
-
-    private List<Element> m_cached;
-
-    private boolean m_validateUsingLocalSchemas = false;
-
-    private Reporter m_reporter;
-
-    public ResourceMetadataProvider(Resource resource, Reporter reporter) {
-        m_resource = resource;
-        m_reporter = reporter;
-    }
-
-    public void setValidateUsingLocalSchemas(boolean validateUsingLocalSchemas) {
-        this.m_validateUsingLocalSchemas = validateUsingLocalSchemas;
-    }
-
-    public List<Element> getMetadatas() throws IOException {
-        if (m_cached == null) {
-            m_cached = new ArrayList<Element>();
-            InputStream stream = null;
-            try {
-                stream = m_resource.openInputStream();
-            } catch (Exception e) {
-                m_reporter.error(e.getMessage());
-                throw new IOException("Cannot read metadata");
-            }
-            StreamMetadataProvider provider = new StreamMetadataProvider(stream, m_reporter);
-            provider.setValidateUsingLocalSchemas(m_validateUsingLocalSchemas);
-            m_cached.addAll(provider.getMetadatas());
-        }
-
-        return m_cached;
-    }
-}
diff --git a/ipojo/bnd-ipojo-plugin/src/test/java/org/apache/felix/ipojo/bnd/PojoizationPluginTestCase.java b/ipojo/bnd-ipojo-plugin/src/test/java/org/apache/felix/ipojo/bnd/PojoizationPluginTestCase.java
deleted file mode 100644
index 0ad3002..0000000
--- a/ipojo/bnd-ipojo-plugin/src/test/java/org/apache/felix/ipojo/bnd/PojoizationPluginTestCase.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * 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.ipojo.bnd;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import aQute.lib.osgi.Analyzer;
-import aQute.lib.osgi.Jar;
-import aQute.lib.osgi.Resource;
-import aQute.lib.osgi.URLResource;
-import aQute.libg.reporter.Reporter;
-import junit.framework.TestCase;
-import org.easymock.EasyMock;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.mockito.Spy;
-
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
-import static org.mockito.Mockito.when;
-
-public class PojoizationPluginTestCase extends TestCase {
-
-    @Mock
-    private Reporter reporter;
-
-    @Spy
-    private Analyzer analyzer = new Analyzer();
-
-    @Spy
-    private Jar jar = new Jar("mock.jar");
-
-    @Override
-    public void setUp() throws Exception {
-        MockitoAnnotations.initMocks(this);
-    }
-
-    public void testAnalysisWithComponentOnlyMetadataXml() throws Exception {
-        PojoizationPlugin plugin = new PojoizationPlugin();
-
-        Map<String, String> props = new HashMap<String, String>();
-
-        Resource resource = new URLResource(getClass().getResource("/metadata-components-only.xml"));
-        doReturn(jar).when(analyzer).getJar();
-        doReturn(resource).when(jar).getResource(eq("META-INF/metadata.xml"));
-
-        plugin.setReporter(reporter);
-        plugin.setProperties(props);
-
-        plugin.analyzeJar(analyzer);
-
-        assertEquals("component { $class=\"com.acme.Thermometer\" }",
-                analyzer.getProperty("IPOJO-Components"));
-    }
-
-    public void testAnalysisWithInstanceOnlyMetadataXml() throws Exception {
-        PojoizationPlugin plugin = new PojoizationPlugin();
-
-        Map<String, String> props = new HashMap<String, String>();
-
-        Resource resource = new URLResource(getClass().getResource("/metadata-instances-only.xml"));
-        doReturn(jar).when(analyzer).getJar();
-        doReturn(resource).when(jar).getResource(eq("META-INF/metadata.xml"));
-
-        plugin.setReporter(reporter);
-        plugin.setProperties(props);
-
-        plugin.analyzeJar(analyzer);
-
-        assertEquals("instance { $component=\"com.acme.Thermometer\" }",
-                analyzer.getProperty("IPOJO-Components"));
-    }
-
-    public void testAnalysisWithComponentsAndInstancesMetadataXml() throws Exception {
-        PojoizationPlugin plugin = new PojoizationPlugin();
-
-        Map<String, String> props = new HashMap<String, String>();
-
-        Resource resource = new URLResource(getClass().getResource("/metadata-components-and-instances.xml"));
-        doReturn(jar).when(analyzer).getJar();
-        doReturn(resource).when(jar).getResource(eq("META-INF/metadata.xml"));
-
-        plugin.setReporter(reporter);
-        plugin.setProperties(props);
-
-        plugin.analyzeJar(analyzer);
-
-        assertEquals("component { $class=\"com.acme.Thermometer\" }" +
-                     "instance { $component=\"com.acme.Thermometer\" }" +
-                     "instance { $component=\"com.acme.Thermometer\" }",
-                     analyzer.getProperty("IPOJO-Components"));
-    }
-}
diff --git a/ipojo/bnd-ipojo-plugin/src/test/resources/metadata-components-and-instances.xml b/ipojo/bnd-ipojo-plugin/src/test/resources/metadata-components-and-instances.xml
deleted file mode 100644
index 19bc3d4..0000000
--- a/ipojo/bnd-ipojo-plugin/src/test/resources/metadata-components-and-instances.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<ipojo>
-  <component class="com.acme.Thermometer" />
-  <instance component="com.acme.Thermometer" />
-  <instance component="com.acme.Thermometer" />
-</ipojo>
diff --git a/ipojo/bnd-ipojo-plugin/src/test/resources/metadata-components-only.xml b/ipojo/bnd-ipojo-plugin/src/test/resources/metadata-components-only.xml
deleted file mode 100644
index cc913fe..0000000
--- a/ipojo/bnd-ipojo-plugin/src/test/resources/metadata-components-only.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<ipojo>
-  <component class="com.acme.Thermometer"/>
-</ipojo>
diff --git a/ipojo/bnd-ipojo-plugin/src/test/resources/metadata-instances-only.xml b/ipojo/bnd-ipojo-plugin/src/test/resources/metadata-instances-only.xml
deleted file mode 100644
index 56aa63a..0000000
--- a/ipojo/bnd-ipojo-plugin/src/test/resources/metadata-instances-only.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<ipojo>
-    <instance component="com.acme.Thermometer"/>
-</ipojo>
\ No newline at end of file
