SLING-7803 prepare module splitup
diff --git a/.gitignore b/.gitignore
index 12746f7..e2d791c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
-/target
+target
 .idea
 .classpath
 .metadata
diff --git a/core/pom.xml b/core/pom.xml
new file mode 100644
index 0000000..3a49e92
--- /dev/null
+++ b/core/pom.xml
@@ -0,0 +1,257 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  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.sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>34-SNAPSHOT</version>
+        <relativePath />
+    </parent>
+
+    <artifactId>org.apache.sling.testing.osgi-mock.core</artifactId>
+    <version>2.4.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+
+    <name>Apache Sling Testing OSGi Mock Core</name>
+    <description>Mock implementation of selected OSGi APIs.</description>
+
+    <dependencies>
+  
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.annotation.versioning</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>osgi.core</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>osgi.cmpn</artifactId>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>15.0</version>
+            <scope>compile</scope>
+        </dependency>
+  
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>3.0.1</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.4</version>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.reflections</groupId>
+            <artifactId>reflections</artifactId>
+            <!-- Do not use version 0.9.10, it created threading issues when running junit tests in parallel (see SLING-5002) -->
+            <version>0.9.9</version>
+            <scope>compile</scope>
+            <!-- exclude all optional dependencies -->
+            <exclusions>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>slf4j-api</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>dom4j</groupId>
+                    <artifactId>dom4j</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>com.google.code.gson</groupId>
+                    <artifactId>gson</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>javax.servlet</groupId>
+                    <artifactId>servlet-api</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>slf4j-simple</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>com.google.code.findbugs</groupId>
+                    <artifactId>annotations</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <!-- Artifact is shaded and inlined, only some classes included (see below) -->
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.commons.osgi</artifactId>
+            <version>2.4.0</version>
+            <scope>compile</scope>
+        </dependency>
+        <!-- Artifact is shaded and inlined, only some classes included (see below) -->
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.framework</artifactId>
+            <version>5.0.0</version>
+            <scope>compile</scope>
+        </dependency>
+        <!-- Artifact is shaded and inlined, only some classes included (see below) -->
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr</artifactId>
+            <version>2.0.4</version>
+            <scope>compile</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.codehaus.mojo</groupId>
+                    <artifactId>animal-sniffer-annotations</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+    
+        <!-- Nullability annotations -->
+        <dependency>
+            <groupId>org.jetbrains</groupId>
+            <artifactId>annotations</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-all</artifactId>
+            <version>1.9.5</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.testing.logging-mock</artifactId>
+            <version>2.0.0</version>
+            <scope>test</scope>
+        </dependency>
+
+    </dependencies>
+  
+    <build>
+        <plugins>
+    
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+            </plugin>
+      
+           <plugin>
+                <groupId>org.apache.rat</groupId>
+                <artifactId>apache-rat-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                        <exclude>src/test/resources/META-INF/test.txt</exclude>
+                        <exclude>src/test/resources/bundleData/nested/first.txt</exclude>
+                        <exclude>src/test/resources/bundleData/nested/second.txt</exclude>
+                        <exclude>dependency-reduced-pom.xml</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+
+           <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <createSourcesJar>true</createSourcesJar>
+                            <shadeSourcesContent>true</shadeSourcesContent>
+                            <artifactSet>
+                                <includes>
+                                    <include>org.apache.sling:org.apache.sling.commons.osgi</include>
+                                    <include>org.apache.felix:org.apache.felix.framework</include>
+                                    <include>org.apache.felix:org.apache.felix.scr</include>
+                                </includes>
+                            </artifactSet>
+                            <relocations>
+                                <relocation>
+                                    <pattern>org.apache.sling.commons.osgi</pattern>
+                                    <shadedPattern>osgimock.org.apache.sling.commons.osgi</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>org.apache.felix.framework</pattern>
+                                    <shadedPattern>osgimock.org.apache.felix.framework</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>org.apache.felix.scr.impl</pattern>
+                                    <shadedPattern>osgimock.org.apache.felix.scr.impl</shadedPattern>
+                                </relocation>
+                            </relocations>
+                            <filters>
+                                <filter>
+                                    <artifact>org.apache.sling:org.apache.sling.commons.osgi</artifact>
+                                    <includes>
+                                        <include>org/apache/sling/commons/osgi/ServiceUtil*</include>
+                                        <include>org/apache/sling/commons/osgi/Order*</include>
+                                    </includes>
+                                </filter>
+                                <filter>
+                                    <artifact>org.apache.felix:org.apache.felix.framework</artifact>
+                                    <includes>
+                                        <include>org/apache/felix/framework/**</include>
+                                    </includes>
+                                </filter>
+                                <filter>
+                                    <artifact>org.apache.felix:org.apache.felix.scr</artifact>
+                                    <includes>
+                                        <include>org/apache/felix/scr/impl/inject/Annotations*</include>
+                                        <include>org/apache/felix/scr/impl/helper/Coercions*</include>
+                                    </includes>
+                                </filter>
+                            </filters>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+        </plugins>
+    </build>
+    
+</project>
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/ComponentContextBuilder.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/ComponentContextBuilder.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/ComponentContextBuilder.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/ComponentContextBuilder.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/ManifestScanner.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/ManifestScanner.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/ManifestScanner.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/ManifestScanner.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MapMergeUtil.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MapMergeUtil.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MapMergeUtil.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MapMergeUtil.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MapUtil.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MapUtil.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MapUtil.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MapUtil.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MatchAllFilter.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MatchAllFilter.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MatchAllFilter.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MatchAllFilter.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockBundle.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundle.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MockBundle.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundle.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockComponentContext.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockComponentContext.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MockComponentContext.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MockComponentContext.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockConfiguration.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockConfiguration.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MockConfiguration.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MockConfiguration.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockConfigurationAdmin.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockConfigurationAdmin.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MockConfigurationAdmin.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MockConfigurationAdmin.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockLogService.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockLogService.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MockLogService.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MockLogService.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockOsgi.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockOsgi.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MockOsgi.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MockOsgi.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceReference.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceReference.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MockServiceReference.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceReference.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/NoScrMetadataException.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/NoScrMetadataException.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/NoScrMetadataException.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/NoScrMetadataException.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtil.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtil.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtil.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtil.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtil.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtil.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtil.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtil.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/ReferenceViolationException.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/ReferenceViolationException.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/ReferenceViolationException.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/ReferenceViolationException.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/context/AbstractContextPlugin.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/context/AbstractContextPlugin.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/context/AbstractContextPlugin.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/context/AbstractContextPlugin.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/context/ContextCallback.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/context/ContextCallback.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/context/ContextCallback.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/context/ContextCallback.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/context/ContextPlugin.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/context/ContextPlugin.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/context/ContextPlugin.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/context/ContextPlugin.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/context/ContextPlugins.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/context/ContextPlugins.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/context/ContextPlugins.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/context/ContextPlugins.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImpl.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImpl.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImpl.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImpl.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/context/package-info.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/context/package-info.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/context/package-info.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/context/package-info.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContext.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContext.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContext.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContext.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextCallback.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextCallback.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextCallback.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextCallback.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/junit/package-info.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/junit/package-info.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/junit/package-info.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/junit/package-info.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/package-info.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/package-info.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/package-info.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/package-info.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/ManifestScannerTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/ManifestScannerTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/ManifestScannerTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/ManifestScannerTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MapUtilTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MapUtilTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MapUtilTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MapUtilTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesOsgiR6Test.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesOsgiR6Test.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesOsgiR6Test.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesOsgiR6Test.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextStaticGreedyReferencesTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextStaticGreedyReferencesTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextStaticGreedyReferencesTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextStaticGreedyReferencesTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MockBundleTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MockComponentContextTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockComponentContextTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MockComponentContextTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MockComponentContextTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MockConfigurationAdminTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockConfigurationAdminTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MockConfigurationAdminTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MockConfigurationAdminTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MockEventAdminTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockEventAdminTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MockEventAdminTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MockEventAdminTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MockLogServiceTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockLogServiceTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MockLogServiceTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MockLogServiceTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MockServiceReferenceTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockServiceReferenceTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MockServiceReferenceTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MockServiceReferenceTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MockServiceReferencesSortTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockServiceReferencesSortTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MockServiceReferencesSortTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MockServiceReferencesSortTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtilTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtilTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtilTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtilTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtilActivateDeactivateTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtilActivateDeactivateTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtilActivateDeactivateTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtilActivateDeactivateTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtilTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtilTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtilTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtilTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/context/ContextPluginsTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/context/ContextPluginsTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/context/ContextPluginsTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/context/ContextPluginsTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImplTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImplTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImplTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImplTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextTest.java
diff --git a/src/test/resources/META-INF/test.txt b/core/src/test/resources/META-INF/test.txt
similarity index 100%
rename from src/test/resources/META-INF/test.txt
rename to core/src/test/resources/META-INF/test.txt
diff --git a/src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.OsgiServiceUtilActivateDeactivateTest.xml b/core/src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.OsgiServiceUtilActivateDeactivateTest.xml
similarity index 100%
rename from src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.OsgiServiceUtilActivateDeactivateTest.xml
rename to core/src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.OsgiServiceUtilActivateDeactivateTest.xml
diff --git a/src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.OsgiServiceUtilTest.xml b/core/src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.OsgiServiceUtilTest.xml
similarity index 100%
rename from src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.OsgiServiceUtilTest.xml
rename to core/src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.OsgiServiceUtilTest.xml
diff --git a/src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.context.OsgiContextImplTest.xml b/core/src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.context.OsgiContextImplTest.xml
similarity index 100%
rename from src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.context.OsgiContextImplTest.xml
rename to core/src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.context.OsgiContextImplTest.xml
diff --git a/src/test/resources/OSGI-INF/serviceComponents.xml b/core/src/test/resources/OSGI-INF/serviceComponents.xml
similarity index 100%
rename from src/test/resources/OSGI-INF/serviceComponents.xml
rename to core/src/test/resources/OSGI-INF/serviceComponents.xml
diff --git a/src/test/resources/bundleData/nested/first.txt b/core/src/test/resources/bundleData/nested/first.txt
similarity index 100%
rename from src/test/resources/bundleData/nested/first.txt
rename to core/src/test/resources/bundleData/nested/first.txt
diff --git a/src/test/resources/bundleData/nested/second.txt b/core/src/test/resources/bundleData/nested/second.txt
similarity index 100%
rename from src/test/resources/bundleData/nested/second.txt
rename to core/src/test/resources/bundleData/nested/second.txt
diff --git a/src/test/resources/simplelogger.properties b/core/src/test/resources/simplelogger.properties
similarity index 100%
rename from src/test/resources/simplelogger.properties
rename to core/src/test/resources/simplelogger.properties
diff --git a/junit4/pom.xml b/junit4/pom.xml
new file mode 100644
index 0000000..a1cdd83
--- /dev/null
+++ b/junit4/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  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.sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>34-SNAPSHOT</version>
+        <relativePath />
+    </parent>
+
+    <artifactId>org.apache.sling.testing.osgi-mock.junit4</artifactId>
+    <version>2.4.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+
+    <name>Apache Sling Testing OSGi Mock JUnit 4</name>
+    <description>Mock implementation of selected OSGi APIs.</description>
+
+    <dependencies>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+            </plugin>
+
+        </plugins>
+    </build>
+
+</project>
diff --git a/junit5/pom.xml b/junit5/pom.xml
new file mode 100644
index 0000000..b60b188
--- /dev/null
+++ b/junit5/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  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.sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>34-SNAPSHOT</version>
+        <relativePath />
+    </parent>
+
+    <artifactId>org.apache.sling.testing.osgi-mock.junit5</artifactId>
+    <version>2.4.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+
+    <name>Apache Sling Testing OSGi Mock JUnit 5</name>
+    <description>Mock implementation of selected OSGi APIs.</description>
+
+    <dependencies>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+            </plugin>
+
+        </plugins>
+    </build>
+
+</project>
diff --git a/pom.xml b/pom.xml
index 443dd2d..db478ce 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,9 +27,9 @@
         <relativePath />
     </parent>
 
-    <artifactId>org.apache.sling.testing.osgi-mock</artifactId>
+    <artifactId>org.apache.sling.testing.osgi-mock.root</artifactId>
     <version>2.4.0-SNAPSHOT</version>
-    <packaging>bundle</packaging>
+    <packaging>pom</packaging>
 
     <name>Apache Sling Testing OSGi Mock</name>
     <description>Mock implementation of selected OSGi APIs.</description>
@@ -38,227 +38,14 @@
         <connection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git</connection>
         <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git</developerConnection>
         <url>https://gitbox.apache.org/repos/asf?p=sling-org-apache-sling-testing-osgi-mock.git</url>
-      <tag>HEAD</tag>
-  </scm>
+        <tag>HEAD</tag>
+    </scm>
     
-    <dependencies>
-  
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.annotation.versioning</artifactId>
-            <scope>provided</scope>
-        </dependency>
+    <modules>
+        <module>core</module>
+        <module>junit4</module>
+        <module>junit5</module>
+        <module>relocate</module>
+    </modules>
 
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>osgi.core</artifactId>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>osgi.cmpn</artifactId>
-            <scope>compile</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-            <version>15.0</version>
-            <scope>compile</scope>
-        </dependency>
-  
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-lang3</artifactId>
-            <version>3.0.1</version>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>commons-io</groupId>
-            <artifactId>commons-io</artifactId>
-            <version>2.4</version>
-            <scope>compile</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-            <scope>compile</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.reflections</groupId>
-            <artifactId>reflections</artifactId>
-            <!-- Do not use version 0.9.10, it created threading issues when running junit tests in parallel (see SLING-5002) -->
-            <version>0.9.9</version>
-            <scope>compile</scope>
-            <!-- exclude all optional dependencies -->
-            <exclusions>
-                <exclusion>
-                    <groupId>org.slf4j</groupId>
-                    <artifactId>slf4j-api</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>dom4j</groupId>
-                    <artifactId>dom4j</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>com.google.code.gson</groupId>
-                    <artifactId>gson</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>javax.servlet</groupId>
-                    <artifactId>servlet-api</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.slf4j</groupId>
-                    <artifactId>slf4j-simple</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>com.google.code.findbugs</groupId>
-                    <artifactId>annotations</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-
-        <!-- Artifact is shaded and inlined, only some classes included (see below) -->
-        <dependency>
-            <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.commons.osgi</artifactId>
-            <version>2.4.0</version>
-            <scope>compile</scope>
-        </dependency>
-        <!-- Artifact is shaded and inlined, only some classes included (see below) -->
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.framework</artifactId>
-            <version>5.0.0</version>
-            <scope>compile</scope>
-        </dependency>
-        <!-- Artifact is shaded and inlined, only some classes included (see below) -->
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.scr</artifactId>
-            <version>2.0.4</version>
-            <scope>compile</scope>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.codehaus.mojo</groupId>
-                    <artifactId>animal-sniffer-annotations</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-    
-        <!-- Nullability annotations -->
-        <dependency>
-            <groupId>org.jetbrains</groupId>
-            <artifactId>annotations</artifactId>
-            <scope>provided</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-all</artifactId>
-            <version>1.9.5</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.testing.logging-mock</artifactId>
-            <version>2.0.0</version>
-            <scope>test</scope>
-        </dependency>
-
-    </dependencies>
-  
-    <build>
-        <plugins>
-    
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <extensions>true</extensions>
-            </plugin>
-      
-           <plugin>
-                <groupId>org.apache.rat</groupId>
-                <artifactId>apache-rat-plugin</artifactId>
-                <configuration>
-                    <excludes>
-                        <exclude>src/test/resources/META-INF/test.txt</exclude>
-                        <exclude>src/test/resources/bundleData/nested/first.txt</exclude>
-                        <exclude>src/test/resources/bundleData/nested/second.txt</exclude>
-                        <exclude>dependency-reduced-pom.xml</exclude>
-                    </excludes>
-                </configuration>
-            </plugin>
-
-           <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-shade-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>shade</goal>
-                        </goals>
-                        <configuration>
-                            <createSourcesJar>true</createSourcesJar>
-                            <shadeSourcesContent>true</shadeSourcesContent>
-                            <artifactSet>
-                                <includes>
-                                    <include>org.apache.sling:org.apache.sling.commons.osgi</include>
-                                    <include>org.apache.felix:org.apache.felix.framework</include>
-                                    <include>org.apache.felix:org.apache.felix.scr</include>
-                                </includes>
-                            </artifactSet>
-                            <relocations>
-                                <relocation>
-                                    <pattern>org.apache.sling.commons.osgi</pattern>
-                                    <shadedPattern>osgimock.org.apache.sling.commons.osgi</shadedPattern>
-                                </relocation>
-                                <relocation>
-                                    <pattern>org.apache.felix.framework</pattern>
-                                    <shadedPattern>osgimock.org.apache.felix.framework</shadedPattern>
-                                </relocation>
-                                <relocation>
-                                    <pattern>org.apache.felix.scr.impl</pattern>
-                                    <shadedPattern>osgimock.org.apache.felix.scr.impl</shadedPattern>
-                                </relocation>
-                            </relocations>
-                            <filters>
-                                <filter>
-                                    <artifact>org.apache.sling:org.apache.sling.commons.osgi</artifact>
-                                    <includes>
-                                        <include>org/apache/sling/commons/osgi/ServiceUtil*</include>
-                                        <include>org/apache/sling/commons/osgi/Order*</include>
-                                    </includes>
-                                </filter>
-                                <filter>
-                                    <artifact>org.apache.felix:org.apache.felix.framework</artifact>
-                                    <includes>
-                                        <include>org/apache/felix/framework/**</include>
-                                    </includes>
-                                </filter>
-                                <filter>
-                                    <artifact>org.apache.felix:org.apache.felix.scr</artifact>
-                                    <includes>
-                                        <include>org/apache/felix/scr/impl/inject/Annotations*</include>
-                                        <include>org/apache/felix/scr/impl/helper/Coercions*</include>
-                                    </includes>
-                                </filter>
-                            </filters>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-
-        </plugins>
-    </build>
-    
 </project>
diff --git a/relocate/pom.xml b/relocate/pom.xml
new file mode 100644
index 0000000..a5c0ed8
--- /dev/null
+++ b/relocate/pom.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  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.sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>34-SNAPSHOT</version>
+        <relativePath />
+    </parent>
+
+    <artifactId>org.apache.sling.testing.osgi-mock</artifactId>
+    <version>2.4.0-SNAPSHOT</version>
+    <packaging>pom</packaging>
+
+    <name>Apache Sling Testing OSGi Mock Relocation</name>
+    <description>Please use artifact 'org.apache.sling.testing.osgi-mock.junit4' instead.</description>
+
+    <distributionManagement>
+        <relocation>
+            <artifactId>org.apache.sling.testing.osgi-mock.junit4</artifactId>
+        </relocation>
+    </distributionManagement>
+
+</project>