diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/pom.xml b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/pom.xml
new file mode 100644
index 0000000..a960ee6
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/pom.xml
@@ -0,0 +1,35 @@
+<!--
+  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>org.apache.felix.ipojo.runtime.core-it</artifactId>
+        <version>1.9.0-SNAPSHOT</version>
+        <relativePath>../../../pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>ipojo-core-factory-version-test</artifactId>
+
+    <name>${project.artifactId}</name>
+
+</project>
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/java/org/apache/felix/ipojo/core/tests/components/MyComponent.java b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/java/org/apache/felix/ipojo/core/tests/components/MyComponent.java
new file mode 100644
index 0000000..ea36a83
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/java/org/apache/felix/ipojo/core/tests/components/MyComponent.java
@@ -0,0 +1,11 @@
+package org.apache.felix.ipojo.core.tests.components;
+
+import org.apache.felix.ipojo.core.tests.services.MyService;
+
+public class MyComponent implements MyService {
+
+    public void foo() {
+        // Nothing to do.
+    }
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/java/org/apache/felix/ipojo/core/tests/components/MyCons.java b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/java/org/apache/felix/ipojo/core/tests/components/MyCons.java
new file mode 100644
index 0000000..a0c4fb5
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/java/org/apache/felix/ipojo/core/tests/components/MyCons.java
@@ -0,0 +1,13 @@
+package org.apache.felix.ipojo.core.tests.components;
+
+import org.apache.felix.ipojo.core.tests.services.MyService;
+
+public class MyCons {
+
+    private MyService[] services;
+
+    public MyCons() {
+        System.out.println("Bound to " + services.length);
+    }
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/java/org/apache/felix/ipojo/core/tests/services/MyService.java b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/java/org/apache/felix/ipojo/core/tests/services/MyService.java
new file mode 100644
index 0000000..bc7e809
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/java/org/apache/felix/ipojo/core/tests/services/MyService.java
@@ -0,0 +1,7 @@
+package org.apache.felix.ipojo.core.tests.services;
+
+public interface MyService {
+
+    public void foo();
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/resources/cons.xml b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/resources/cons.xml
new file mode 100644
index 0000000..58e7e9c
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/resources/cons.xml
@@ -0,0 +1,8 @@
+<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
+	xmlns="org.apache.felix.ipojo">
+	<component name="cons" classname="org.apache.felix.ipojo.core.tests.components.MyCons">
+		<requires field="services"/>
+	</component>
+	<instance component="cons" name="mycons"/>
+</ipojo>
\ No newline at end of file
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/resources/instances.xml b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/resources/instances.xml
new file mode 100644
index 0000000..0ffad9e
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/resources/instances.xml
@@ -0,0 +1,22 @@
+<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="org.apache.felix.ipojo http://people.apache.org/~clement/ipojo/SCHEMA-DEV/core.xsd"
+	xmlns="org.apache.felix.ipojo">
+
+	<instance component="org.apache.felix.ipojo.core.tests.components.MyComponent"
+		version="1.0"
+		name="instance-v1"
+	/>
+
+	<instance component="org.apache.felix.ipojo.core.tests.components.MyComponent"
+		version="1.1"
+		name="instance-v1.1"
+	/>
+
+	<instance component="org.apache.felix.ipojo.core.tests.components.MyComponent"
+		name="instance-any"
+	/>
+
+	<instance component="MyComponent"
+		name="MyComponentInstance"
+	/>
+</ipojo>
\ No newline at end of file
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/resources/provider-v1.1.xml b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/resources/provider-v1.1.xml
new file mode 100644
index 0000000..b2fe30d
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/resources/provider-v1.1.xml
@@ -0,0 +1,7 @@
+<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="org.apache.felix.ipojo http://people.apache.org/~clement/ipojo/SCHEMA-DEV/core.xsd"
+	xmlns="org.apache.felix.ipojo">
+	<component classname="org.apache.felix.ipojo.core.tests.components.MyComponent" version="1.1">
+		<provides/>
+	</component>
+</ipojo>
\ No newline at end of file
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/resources/provider-v1.xml b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/resources/provider-v1.xml
new file mode 100644
index 0000000..e224135
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/resources/provider-v1.xml
@@ -0,0 +1,12 @@
+<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="org.apache.felix.ipojo http://people.apache.org/~clement/ipojo/SCHEMA-DEV/core.xsd"
+	xmlns="org.apache.felix.ipojo">
+	<component classname="org.apache.felix.ipojo.core.tests.components.MyComponent" version="1.0">
+		<provides/>
+	</component>
+
+
+	<component classname="org.apache.felix.ipojo.core.tests.components.MyComponent" name="MyComponent">
+		<provides/>
+	</component>
+</ipojo>
\ No newline at end of file
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/resources/vprovider-v1.xml b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/resources/vprovider-v1.xml
new file mode 100644
index 0000000..25ae073
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/resources/vprovider-v1.xml
@@ -0,0 +1,8 @@
+<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="org.apache.felix.ipojo http://people.apache.org/~clement/ipojo/SCHEMA-DEV/core.xsd"
+	xmlns="org.apache.felix.ipojo">
+	<component name="provider" classname="org.apache.felix.ipojo.core.tests.components.MyComponent" version="1.0">
+		<provides/>
+	</component>
+	<instance component="provider" version="1.0"/>
+</ipojo>
\ No newline at end of file
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/resources/vprovider-v2.xml b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/resources/vprovider-v2.xml
new file mode 100644
index 0000000..9f814f8
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/main/resources/vprovider-v2.xml
@@ -0,0 +1,9 @@
+<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="org.apache.felix.ipojo http://people.apache.org/~clement/ipojo/SCHEMA-DEV/core.xsd"
+	xmlns="org.apache.felix.ipojo">
+	<component name="provider" classname="org.apache.felix.ipojo.core.tests.components.MyComponent" version="2.0">
+		<provides/>
+	</component>
+	<instance component="provider" version="2.0"/>
+
+</ipojo>
\ No newline at end of file
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/test/java/org/apache/felix/ipojo/tests/core/Common.java b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/test/java/org/apache/felix/ipojo/tests/core/Common.java
new file mode 100644
index 0000000..76eacae
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/test/java/org/apache/felix/ipojo/tests/core/Common.java
@@ -0,0 +1,196 @@
+package org.apache.felix.ipojo.tests.core;
+
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.Logger;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.filefilter.TrueFileFilter;
+import org.apache.felix.ipojo.core.tests.services.MyService;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.options.CompositeOption;
+import org.ops4j.pax.exam.options.DefaultCompositeOption;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+import org.ops4j.pax.tinybundles.core.TinyBundle;
+import org.ops4j.pax.tinybundles.core.TinyBundles;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.ow2.chameleon.testing.helpers.IPOJOHelper;
+import org.ow2.chameleon.testing.helpers.OSGiHelper;
+import org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOStrategy;
+import org.slf4j.LoggerFactory;
+
+import javax.inject.Inject;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import static org.ops4j.pax.exam.CoreOptions.*;
+import static org.ops4j.pax.tinybundles.core.TinyBundles.withBnd;
+
+/**
+ * Bootstrap the test from this project
+ */
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class Common {
+
+    @Inject
+    BundleContext bc;
+
+    OSGiHelper osgiHelper;
+    IPOJOHelper ipojoHelper;
+
+    Bundle testedBundle;
+
+    @Configuration
+    public Option[] config() throws IOException {
+        Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
+        root.setLevel(Level.INFO);
+
+        return options(
+                ipojoBundles(),
+                junitBundles(),
+                //testedBundle(),
+                systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("WARN")
+        );
+    }
+
+    public Option createServiceBundleV1() throws MalformedURLException {
+        File out = new File("target/tested/service-v1.jar");
+
+        if (out.exists()) {
+            return bundle(out.toURI().toURL().toExternalForm());
+        }
+
+        InputStream is = TinyBundles.bundle()
+                .add(MyService.class)
+                .set(Constants.BUNDLE_SYMBOLICNAME, "ServiceInterface")
+                .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.core.tests.services")
+                .build(withBnd());
+        try {
+            FileUtils.copyInputStreamToFile(is, out);
+            return bundle(out.toURI().toURL().toExternalForm());
+        } catch (MalformedURLException e) {
+            throw new RuntimeException("Cannot compute the url of the bundle");
+        } catch (IOException e) {
+            throw new RuntimeException("Cannot write of the bundle");
+        }
+    }
+
+    public Option createServiceBundleV2() throws MalformedURLException {
+        File out = new File("target/tested/service-v2.jar");
+
+        if (out.exists()) {
+            return bundle(out.toURI().toURL().toExternalForm());
+        }
+
+        InputStream is = TinyBundles.bundle()
+                .add(MyService.class)
+                .set(Constants.BUNDLE_SYMBOLICNAME, "ServiceInterface")
+                .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.core.tests.services; version=\"2.0.0\"")
+                .build(withBnd());
+        try {
+            FileUtils.copyInputStreamToFile(is, out);
+            return bundle(out.toURI().toURL().toExternalForm());
+        } catch (MalformedURLException e) {
+            throw new RuntimeException("Cannot compute the url of the bundle");
+        } catch (IOException e) {
+            throw new RuntimeException("Cannot write of the bundle");
+        }
+    }
+
+
+
+
+
+
+
+    @Before
+    public void commonSetUp() {
+        osgiHelper = new OSGiHelper(bc);
+        ipojoHelper = new IPOJOHelper(bc);
+
+        // Dump OSGi Framework information
+        String vendor = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_VENDOR);
+        if (vendor == null) {
+            vendor = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_SYMBOLICNAME);
+        }
+        String version = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_VERSION);
+        System.out.println("OSGi Framework : " + vendor + " - " + version);
+    }
+
+    @After
+    public void commonTearDown() {
+        ipojoHelper.dispose();
+        osgiHelper.dispose();
+    }
+
+    public CompositeOption ipojoBundles() {
+        return new DefaultCompositeOption(
+                mavenBundle("org.apache.felix", "org.apache.felix.ipojo").versionAsInProject(),
+                mavenBundle("org.ow2.chameleon.testing", "osgi-helpers").versionAsInProject());
+    }
+
+    public Option testedBundle() throws MalformedURLException {
+        File out = new File("target/tested/bundle.jar");
+
+        TinyBundle tested = TinyBundles.bundle();
+
+        // We look inside target/classes to find the class and resources
+        File classes = new File("target/classes");
+        Collection<File> files = FileUtils.listFilesAndDirs(classes, TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE);
+        List<File> services = new ArrayList<File>();
+        for (File file : files) {
+            if (file.isDirectory()) {
+                // By convention we export of .services and .service package
+                if (file.getName().endsWith("services") || file.getName().endsWith("service")) {
+                    services.add(file);
+                }
+            } else {
+                // We need to compute the path
+                String path = file.getAbsolutePath().substring(classes.getAbsolutePath().length() + 1);
+                tested.add(path, file.toURI().toURL());
+                System.out.println(file.getName() + " added to " + path);
+            }
+        }
+
+        String export = "";
+        for (File file : services) {
+            if (export.length() > 0) {
+                export += ", ";
+            }
+            String path = file.getAbsolutePath().substring(classes.getAbsolutePath().length() + 1);
+            String packageName = path.replace('/', '.');
+            export += packageName;
+        }
+
+        System.out.println("Exported packages : " + export);
+
+        InputStream inputStream = tested
+                .set(Constants.BUNDLE_SYMBOLICNAME, "test.bundle")
+                .set(Constants.IMPORT_PACKAGE, "*")
+                .set(Constants.EXPORT_PACKAGE, export)
+                .build(IPOJOStrategy.withiPOJO(new File("src/main/resources")));
+
+        try {
+            FileUtils.copyInputStreamToFile(inputStream, out);
+            return bundle(out.toURI().toURL().toExternalForm());
+        } catch (MalformedURLException e) {
+            throw new RuntimeException("Cannot compute the url of the manipulated bundle");
+        } catch (IOException e) {
+            throw new RuntimeException("Cannot write of the manipulated bundle");
+        }
+    }
+
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/test/java/org/apache/felix/ipojo/tests/core/FactoryVersionTest.java b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/test/java/org/apache/felix/ipojo/tests/core/FactoryVersionTest.java
new file mode 100644
index 0000000..58bbd38
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/test/java/org/apache/felix/ipojo/tests/core/FactoryVersionTest.java
@@ -0,0 +1,157 @@
+package org.apache.felix.ipojo.tests.core;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.felix.ipojo.architecture.Architecture;
+import org.apache.felix.ipojo.core.tests.components.MyComponent;
+import org.apache.felix.ipojo.core.tests.services.MyService;
+import org.junit.Assert;
+import org.junit.Test;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.tinybundles.core.TinyBundles;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Constants;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOStrategy;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+
+public class FactoryVersionTest extends Common {
+
+
+    @org.ops4j.pax.exam.Configuration
+    public Option[] config() throws IOException {
+
+        Option[] options = super.config();
+
+        File provider1 = new File("target/tested/provider-v1.jar");
+        FileUtils.copyInputStreamToFile(
+                TinyBundles.bundle()
+                        .add(MyComponent.class)
+                        .set(Constants.BUNDLE_SYMBOLICNAME, "ProviderV1")
+                        .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.core.tests.services")
+                        .build(IPOJOStrategy.withiPOJO(new File("src/main/resources/provider-v1.xml"))),
+                provider1);
+
+        File provider2 = new File("target/tested/provider-v1.1.jar");
+        FileUtils.copyInputStreamToFile(
+                TinyBundles.bundle()
+                        .add(MyComponent.class)
+                        .set(Constants.BUNDLE_SYMBOLICNAME, "ProviderV1.1")
+                        .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.core.tests.services")
+                        .build(IPOJOStrategy.withiPOJO(new File("src/main/resources/provider-v1.1.xml"))),
+                provider2);
+
+        File instance = new File("target/tested/instance.jar");
+        FileUtils.copyInputStreamToFile(
+                TinyBundles.bundle()
+                        .set(Constants.BUNDLE_SYMBOLICNAME, "Instances")
+                        .build(IPOJOStrategy.withiPOJO(new File("src/main/resources/instances.xml"))),
+                instance);
+
+        List<Option> optionList = new ArrayList<Option>();
+        optionList.addAll(Arrays.asList(options));
+
+        optionList.add(createServiceBundleV1());
+        optionList.add(bundle(provider1.toURI().toURL().toExternalForm()));
+        optionList.add(bundle(provider2.toURI().toURL().toExternalForm()));
+        optionList.add(bundle(instance.toURI().toURL().toExternalForm()));
+
+        return optionList.toArray(new Option[optionList.size()]);
+    }
+
+    @Test
+    public void testDeploy() {
+        Bundle[] bundles = bc.getBundles();
+        for (Bundle bundle : bundles) {
+            System.out.println("Bundle deployed : " + bundle.getSymbolicName() + " / " + bundle.getState());
+            Assert.assertEquals(bundle.getSymbolicName() + " is not active", Bundle.ACTIVE, bundle.getState());
+        }
+    }
+
+    @Test
+    public void testInstanceArchitecture() {
+        // Version 1.0
+        ServiceReference refv1 = ipojoHelper.getServiceReferenceByName(Architecture.class.getName(), "instance-v1");
+        Assert.assertNotNull(refv1);
+        Architecture archv1 = (Architecture) osgiHelper.getServiceObject(refv1);
+
+        String version = archv1.getInstanceDescription().getComponentDescription().getVersion();
+        Assert.assertEquals("1.0", version);
+
+        // Version 1.1
+        ServiceReference refv11 = ipojoHelper.getServiceReferenceByName(Architecture.class.getName(), "instance-v1.1");
+        Assert.assertNotNull(refv11);
+        Architecture archv11 = (Architecture) osgiHelper.getServiceObject(refv11);
+
+        String version11 = archv11.getInstanceDescription().getComponentDescription().getVersion();
+        Assert.assertEquals("1.1", version11);
+
+        // No Version
+        ServiceReference refany = ipojoHelper.getServiceReferenceByName(Architecture.class.getName(), "instance-any");
+        Assert.assertNotNull(refany);
+        Architecture archany = (Architecture) osgiHelper.getServiceObject(refany);
+
+        String any = archany.getInstanceDescription().getComponentDescription().getVersion();
+        Assert.assertNotNull(any);
+
+        // No version set in the factory, so no version.
+        ServiceReference refmci = ipojoHelper.getServiceReferenceByName(Architecture.class.getName(), "MyComponentInstance");
+        Assert.assertNotNull(refmci);
+        Architecture archmcy = (Architecture) osgiHelper.getServiceObject(refmci);
+
+        String mci = archmcy.getInstanceDescription().getComponentDescription().getVersion();
+        Assert.assertNull(mci);
+
+    }
+
+    @Test
+    public void testServiceProperty() throws InvalidSyntaxException {
+
+        // Version 1.0
+        //ServiceReference refv1 = ipojoHelper.getServiceReferenceByName(MyService.class.getName(), "instance-v1");
+        ServiceReference[] refv1 = bc.getAllServiceReferences(MyService.class.getName(),
+                "(instance.name=instance-v1)");
+        Assert.assertNotNull(refv1);
+        String version = (String) refv1[0].getProperty("factory.version");
+        Assert.assertEquals("1.0", version);
+
+        // Version 1.1
+        for(ServiceReference ref : bc.getAllServiceReferences(null, null)) {
+            System.out.println("Service : " + ref.getProperty("instance.name"));
+        }
+
+        ServiceReference[] refv11 = bc.getAllServiceReferences(MyService.class.getName(),
+                "(instance.name=instance-v1.1)");
+        //ServiceReference refv11 = ipojoHelper.getServiceReferenceByName(MyService.class.getName(), "instance-v1.1");
+        Assert.assertNotNull(refv11);
+        String version11 = (String) refv11[0].getProperty("factory.version");
+
+        Assert.assertEquals("1.1", version11);
+
+        // No Version
+        ServiceReference[] refany = bc.getAllServiceReferences(MyService.class.getName(),
+                "(instance.name=instance-any)");
+
+        // ServiceReference refany = ipojoHelper.getServiceReferenceByName(MyService.class.getName(), "instance-any");
+        Assert.assertNotNull(refany);
+        String any = (String) refany[0].getProperty("factory.version");
+        Assert.assertNotNull(any);
+
+        // No version set in the factory, so no version.
+        ServiceReference[] refmci = bc.getAllServiceReferences(MyService.class.getName(),
+                "(instance.name=MyComponentInstance)");
+        //ServiceReference refmci = ipojoHelper.getServiceReferenceByName(MyService.class.getName(), "MyComponentInstance");
+        Assert.assertNotNull(refmci);
+        String mci = (String) refmci[0].getProperty("factory.version");
+        Assert.assertNull(mci);
+    }
+
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/test/java/org/apache/felix/ipojo/tests/core/VersionConflictTest.java b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/test/java/org/apache/felix/ipojo/tests/core/VersionConflictTest.java
new file mode 100644
index 0000000..5f9cddf
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-factory-version-test/src/test/java/org/apache/felix/ipojo/tests/core/VersionConflictTest.java
@@ -0,0 +1,286 @@
+package org.apache.felix.ipojo.tests.core;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.felix.ipojo.architecture.Architecture;
+import org.apache.felix.ipojo.architecture.HandlerDescription;
+import org.apache.felix.ipojo.core.tests.components.MyComponent;
+import org.apache.felix.ipojo.core.tests.components.MyCons;
+import org.apache.felix.ipojo.core.tests.services.MyService;
+import org.apache.felix.ipojo.handlers.dependency.Dependency;
+import org.apache.felix.ipojo.handlers.dependency.DependencyDescription;
+import org.apache.felix.ipojo.handlers.dependency.DependencyHandlerDescription;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
+import org.ops4j.pax.tinybundles.core.TinyBundles;
+import org.osgi.framework.*;
+import org.osgi.service.packageadmin.ExportedPackage;
+import org.osgi.service.packageadmin.PackageAdmin;
+import org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOStrategy;
+
+import javax.inject.Inject;
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+import static org.ops4j.pax.tinybundles.core.TinyBundles.withBnd;
+
+@ExamReactorStrategy(PerMethod.class)
+public class VersionConflictTest extends Common {
+
+    @Inject
+    private BundleContext context;
+
+
+    @Configuration
+    public Option[] config() throws IOException {
+
+        List<Option> options = new ArrayList<Option>();
+        options.addAll(Arrays.asList(super.config()));
+
+        File tmp = new File("target/tmp");
+        tmp.mkdirs();
+
+        File f1 = new File(tmp, "service-interface-v1.jar");
+        FileUtils.copyInputStreamToFile(
+                TinyBundles.bundle()
+                        .add(MyService.class)
+                        .set(Constants.BUNDLE_SYMBOLICNAME, "ServiceInterfaceV1")
+                        .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.core.tests.services; version=\"1.0.0\"")
+                        .build(withBnd()),
+                f1);
+
+        File f2 = new File(tmp, "service-interface-v2.jar");
+        FileUtils.copyInputStreamToFile(
+                TinyBundles.bundle()
+                        .add(MyService.class)
+                        .set(Constants.BUNDLE_SYMBOLICNAME, "ServiceInterfaceV2")
+                        .set(Constants.BUNDLE_VERSION, "2.0.0")
+                        .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.core.tests.services; version=\"2.0.0\"")
+                        .build(withBnd()),
+                f2);
+
+        File c1 = new File(tmp, "component-v1.jar");
+        FileUtils.copyInputStreamToFile(
+                TinyBundles.bundle()
+                        .add(MyComponent.class)
+                        .set(Constants.BUNDLE_SYMBOLICNAME, "ProviderV1")
+                        .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.core.tests.services; version=\"[1.0.0, 1.0.0]\"")
+                        .build(IPOJOStrategy.withiPOJO(new File("src/main/resources/vprovider-v1.xml"))),
+                c1);
+
+        File c2 = new File(tmp, "component-v2.jar");
+        FileUtils.copyInputStreamToFile(
+                TinyBundles.bundle()
+                        .add(MyComponent.class)
+                        .set(Constants.BUNDLE_SYMBOLICNAME, "ProviderV2")
+                        .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.core.tests.services; version=\"[2.0.0," +
+                                " 2.0.0]\"")
+                        .build(IPOJOStrategy.withiPOJO(new File("src/main/resources/vprovider-v2.xml"))),
+                c2);
+
+        File cons = new File(tmp, "cons.jar");
+        FileUtils.copyInputStreamToFile(
+                TinyBundles.bundle()
+                        .add(MyCons.class)
+                        .set(Constants.BUNDLE_SYMBOLICNAME, "MyCons")
+                        .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.core.tests.services; version=\"[2.0.0, " +
+                                "2.0.0]\"")
+                        .set(Constants.BUNDLE_VERSION, "2.0")
+                        .build(IPOJOStrategy.withiPOJO(new File("src/main/resources/cons.xml"))),
+                cons);
+
+        File consV1 = new File(tmp, "cons-v1.jar");
+        FileUtils.copyInputStreamToFile(
+                TinyBundles.bundle()
+                        .add(MyCons.class)
+                        .set(Constants.BUNDLE_SYMBOLICNAME, "MyCons")
+                        .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.core.tests.services; version=\"[1.0.0, " +
+                                "2.0.0)\"")
+                        .set(Constants.BUNDLE_VERSION, "1.0")
+                        .build(IPOJOStrategy.withiPOJO(new File("src/main/resources/cons.xml"))),
+                consV1);
+
+        Option[] opt = options(
+                systemProperty("url1").value(f1.toURI().toURL().toExternalForm()),
+                systemProperty("url2").value(f2.toURI().toURL().toExternalForm()),
+
+                systemProperty("c1").value(c1.toURI().toURL().toExternalForm()),
+                systemProperty("c2").value(c2.toURI().toURL().toExternalForm()),
+                systemProperty("cons").value(cons.toURI().toURL().toExternalForm()),
+                systemProperty("consV1").value(consV1.toURI().toURL().toExternalForm())
+        );
+
+        options.addAll(Arrays.asList(opt));
+
+        return options.toArray(new Option[options.size()]);
+    }
+
+//    @ProbeBuilder
+//    public TestProbeBuilder probe(TestProbeBuilder builder) {
+//        builder.setHeader(Constants.IMPORT_PACKAGE, "org.osgi.framework, org.apache.felix.ipojo, " +
+//                "org.ow2.chameleon.testing.helpers, org.osgi.service.packageadmin, " +
+//                "org.apache.felix.ipojo.architecture, org.apache.felix.ipojo.handlers.dependency");
+//        builder.setHeader(Constants.DYNAMICIMPORT_PACKAGE, "org.ops4j.pax.exam,org.junit,javax.inject," +
+//                "org.ops4j.pax.exam.options");
+//        builder.setHeader("Bundle-ManifestVersion", "2");
+//        return builder;
+//    }
+
+    @Test
+    public void deployBundlesAtRuntime() throws MalformedURLException, BundleException, InvalidSyntaxException {
+
+        Bundle b1 = context.installBundle(context.getProperty("url1"));
+        b1.start();
+
+
+        Bundle b3 = context.installBundle(context.getProperty("c1"));
+        b3.start();
+
+        Bundle b2 = context.installBundle(context.getProperty("url2"));
+        b2.start();
+
+        Bundle b4 = context.installBundle(context.getProperty("c2"));
+        b4.start();
+
+        Bundle b5 = context.installBundle(context.getProperty("cons"));
+        b5.start();
+
+
+        Bundle[] bundles = context.getBundles();
+        for (Bundle bundle : bundles) {
+            System.out.println("bundle " + bundle.getSymbolicName() + " : " + (bundle.getState() == Bundle.ACTIVE));
+            //Assert.assertEquals(bundles[i].getSymbolicName() + " is not active", Bundle.ACTIVE, bundles[i].getState());
+        }
+
+        //TODO Migrate to new API, be aware that the new API may not be implemented on all platforms.
+        PackageAdmin pa = osgiHelper.getPackageAdmin();
+        Bundle b = pa.getBundles("ServiceInterfaceV1", null)[0];
+        ExportedPackage[] packages = pa.getExportedPackages(b);
+        if (packages == null) {
+            System.out.println("Packages  ServiceInterfaceV1 : " + 0);
+        } else {
+            System.out.println("Packages  ServiceInterfaceV1 : " + packages.length);
+            for (ExportedPackage p : packages) {
+                System.out.println("Package : " + p.getName() + " - " + p.getVersion().toString());
+            }
+        }
+        b = pa.getBundles("ServiceInterfaceV2", null)[0];
+        packages = pa.getExportedPackages(b);
+        System.out.println("Packages  ServiceInterfaceV2 : " + packages.length);
+        for (ExportedPackage p : packages) {
+            System.out.println("Package : " + p.getName() + " - " + p.getVersion().toString());
+        }
+
+        osgiHelper.waitForService(Architecture.class.getName(), "(architecture.instance=mycons)", 2000);
+
+        // Check that the two services are provided.
+        ServiceReference[] refs = context.getAllServiceReferences("org.apache.felix.ipojo.core.tests.services.MyService", null);
+        Assert.assertNotNull(refs);
+        Assert.assertEquals(2, refs.length);
+
+        ServiceReference refv1 = ipojoHelper.getServiceReferenceByName(Architecture.class.getName(), "mycons");
+        Assert.assertNotNull(refv1);
+        Architecture arch = (Architecture) osgiHelper.getServiceObject(refv1);
+
+        HandlerDescription desc = arch.getInstanceDescription().getHandlerDescription("org.apache.felix.ipojo:requires");
+        Assert.assertNotNull(desc);
+
+        DependencyHandlerDescription d = (DependencyHandlerDescription) desc;
+        Assert.assertNotNull(d.getDependencies());
+        Assert.assertEquals(1, d.getDependencies().length);
+
+        DependencyDescription dep = d.getDependencies()[0];
+        Assert.assertEquals(Dependency.RESOLVED, dep.getState());
+
+        Assert.assertEquals(1, dep.getServiceReferences().size());
+        ServiceReference r = (ServiceReference) dep.getServiceReferences().get(0);
+        Assert.assertEquals("provider", r.getProperty("factory.name"));
+        Assert.assertEquals("2.0", r.getProperty("factory.version"));
+    }
+
+    @Test
+    @Ignore("Does not work anymore, but the scenario runs as expected in a regular framework. The check find the " +
+            "version 2.0 of the service instead of the 1.0")
+    public void deployBundlesAtRuntimeV1() throws MalformedURLException, BundleException, InvalidSyntaxException {
+
+        Bundle b1 = context.installBundle(context.getProperty("url1"));
+        b1.start();
+
+
+        Bundle b3 = context.installBundle(context.getProperty("c1"));
+        b3.start();
+
+        Bundle b2 = context.installBundle(context.getProperty("url2"));
+        b2.start();
+
+        Bundle b4 = context.installBundle(context.getProperty("c2"));
+        b4.start();
+
+        Bundle b5 = context.installBundle(context.getProperty("consV1"));
+        b5.start();
+
+
+        Bundle[] bundles = context.getBundles();
+        for (int i = 0; i < bundles.length; i++) {
+            System.out.println("bundle " + bundles[i].getSymbolicName() + " : " + (bundles[i].getState() == Bundle.ACTIVE));
+        }
+
+
+        PackageAdmin pa = osgiHelper.getPackageAdmin();
+        Bundle b = pa.getBundles("ServiceInterfaceV1", null)[0];
+        ExportedPackage[] packages = pa.getExportedPackages(b);
+        if (packages == null) {
+            System.out.println("Packages  ServiceInterfaceV1 : " + 0);
+        } else {
+            System.out.println("Packages  ServiceInterfaceV1 : " + packages.length);
+            for (ExportedPackage p : packages) {
+                System.out.println("Package : " + p.getName() + " - " + p.getVersion().toString());
+            }
+        }
+        b = pa.getBundles("ServiceInterfaceV2", null)[0];
+        packages = pa.getExportedPackages(b);
+        System.out.println("Packages  ServiceInterfaceV2 : " + packages.length);
+        for (ExportedPackage p : packages) {
+            System.out.println("Package : " + p.getName() + " - " + p.getVersion().toString());
+        }
+
+        osgiHelper.waitForService(Architecture.class.getName(), "(architecture.instance=mycons)", 2000);
+
+        // Check that the two services are provided.
+        ServiceReference[] refs = context.getAllServiceReferences("org.apache.felix.ipojo.core.tests.services.MyService", null);
+        Assert.assertNotNull(refs);
+        Assert.assertEquals(2, refs.length);
+
+        ServiceReference refv1 = ipojoHelper.getServiceReferenceByName(Architecture.class.getName(), "mycons");
+        Assert.assertNotNull(refv1);
+        Architecture arch = (Architecture) osgiHelper.getServiceObject(refv1);
+
+        HandlerDescription desc = arch.getInstanceDescription().getHandlerDescription("org.apache.felix.ipojo:requires");
+        Assert.assertNotNull(desc);
+
+        DependencyHandlerDescription d = (DependencyHandlerDescription) desc;
+        Assert.assertNotNull(d.getDependencies());
+        Assert.assertEquals(1, d.getDependencies().length);
+
+        DependencyDescription dep = d.getDependencies()[0];
+        Assert.assertEquals(Dependency.RESOLVED, dep.getState());
+
+        Assert.assertEquals(1, dep.getServiceReferences().size());
+        ServiceReference r = (ServiceReference) dep.getServiceReferences().get(0);
+
+        Assert.assertEquals("provider", r.getProperty("factory.name"));
+        Assert.assertEquals("1.0", r.getProperty("factory.version"));
+    }
+
+
+}
