Merge branch 'trunk' into feature/update-osgi-r7
diff --git a/oak-api/pom.xml b/oak-api/pom.xml
index 53ad801..b10d078 100644
--- a/oak-api/pom.xml
+++ b/oak-api/pom.xml
@@ -61,17 +61,7 @@
<!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
+ <artifactId>org.osgi.annotation.versioning</artifactId>
<scope>provided</scope>
</dependency>
diff --git a/oak-auth-external/pom.xml b/oak-auth-external/pom.xml
index fa9a467..2eff575 100644
--- a/oak-auth-external/pom.xml
+++ b/oak-auth-external/pom.xml
@@ -61,12 +61,12 @@
<!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>org.osgi.service.component</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
@@ -81,8 +81,8 @@
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
- <scope>provided</scope>
+ <artifactId>org.osgi.annotation.versioning</artifactId>
+ <scope>provided</scope>
</dependency>
<!-- Jackrabbit dependencies -->
diff --git a/oak-authorization-cug/pom.xml b/oak-authorization-cug/pom.xml
index 348a1f8..704a042 100644
--- a/oak-authorization-cug/pom.xml
+++ b/oak-authorization-cug/pom.xml
@@ -110,17 +110,12 @@
<!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
+ <artifactId>org.osgi.annotation.versioning</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/oak-authorization-principalbased/pom.xml b/oak-authorization-principalbased/pom.xml
index c286ff1..a322814 100644
--- a/oak-authorization-principalbased/pom.xml
+++ b/oak-authorization-principalbased/pom.xml
@@ -59,17 +59,12 @@
<!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
+ <artifactId>org.osgi.annotation.versioning</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/oak-blob-cloud-azure/pom.xml b/oak-blob-cloud-azure/pom.xml
index d0b159b..e1e6246 100644
--- a/oak-blob-cloud-azure/pom.xml
+++ b/oak-blob-cloud-azure/pom.xml
@@ -62,12 +62,17 @@
<!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>org.osgi.annotation.versioning</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>osgi.core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.service.component</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/oak-blob-cloud/pom.xml b/oak-blob-cloud/pom.xml
index f5ea21e..f3ab23b 100644
--- a/oak-blob-cloud/pom.xml
+++ b/oak-blob-cloud/pom.xml
@@ -57,12 +57,17 @@
<!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>org.osgi.annotation.versioning</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>osgi.core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.service.component</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/oak-blob-plugins/pom.xml b/oak-blob-plugins/pom.xml
index 1841a9d..c193e96 100644
--- a/oak-blob-plugins/pom.xml
+++ b/oak-blob-plugins/pom.xml
@@ -50,12 +50,7 @@
<!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>org.osgi.annotation.versioning</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
@@ -63,6 +58,16 @@
<artifactId>org.apache.felix.scr.annotations</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>osgi.core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.service.component</artifactId>
+ <scope>provided</scope>
+ </dependency>
<!-- JCR and Jackrabbit dependencies -->
<dependency>
@@ -196,10 +201,6 @@
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
- </dependency>
</dependencies>
</project>
diff --git a/oak-blob/pom.xml b/oak-blob/pom.xml
index 3fc9c72..8d37f8f 100644
--- a/oak-blob/pom.xml
+++ b/oak-blob/pom.xml
@@ -52,17 +52,17 @@
<!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>org.osgi.annotation.versioning</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
+ <artifactId>org.osgi.service.component</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/oak-commons/pom.xml b/oak-commons/pom.xml
index 513faeb..3a99bf5 100644
--- a/oak-commons/pom.xml
+++ b/oak-commons/pom.xml
@@ -75,7 +75,7 @@
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
+ <artifactId>org.osgi.annotation.versioning</artifactId>
<scope>provided</scope>
</dependency>
diff --git a/oak-core-spi/pom.xml b/oak-core-spi/pom.xml
index d0203c2..24a3490 100644
--- a/oak-core-spi/pom.xml
+++ b/oak-core-spi/pom.xml
@@ -81,17 +81,17 @@
<!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>org.osgi.service.component</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
+ <artifactId>org.osgi.annotation.versioning</artifactId>
<scope>provided</scope>
</dependency>
diff --git a/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/osgi/OsgiWhiteboard.java b/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/osgi/OsgiWhiteboard.java
index bba5d22..bde134a 100644
--- a/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/osgi/OsgiWhiteboard.java
+++ b/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/osgi/OsgiWhiteboard.java
@@ -69,13 +69,15 @@
Objects.requireNonNull(properties);
checkArgument(type.isInstance(service));
- Dictionary<Object, Object> dictionary = new Hashtable<Object, Object>();
+ // convert Map to Dictionary
+ Dictionary<String, Object> dictionary = new Hashtable<>();
for (Map.Entry<?, ?> entry : properties.entrySet()) {
- dictionary.put(entry.getKey(), entry.getValue());
+ // always assume String as key, otherwise throwing a CCE is fine
+ dictionary.put(String.class.cast(entry.getKey()), entry.getValue());
}
- final ServiceRegistration registration =
- context.registerService(type.getName(), service, dictionary);
+ final ServiceRegistration<T> registration =
+ context.registerService(type, service, dictionary);
return new Registration() {
private volatile boolean unregistered;
@Override
diff --git a/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/spi/whiteboard/Whiteboard.java b/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/spi/whiteboard/Whiteboard.java
index 805d89e..bc7bf46 100644
--- a/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/spi/whiteboard/Whiteboard.java
+++ b/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/spi/whiteboard/Whiteboard.java
@@ -29,7 +29,7 @@
*
* @param type type of the service
* @param service service instance
- * @param properties service properties
+ * @param properties service properties. Those need to use {@link String} keys, but for backwards compatibility reasons this is not enforced via generics.
* @return service registration
*/
<T> Registration register(Class<T> type, T service, Map<?, ?> properties);
diff --git a/oak-core-spi/src/test/java/org/apache/jackrabbit/oak/osgi/OsgiWhiteboardTest.java b/oak-core-spi/src/test/java/org/apache/jackrabbit/oak/osgi/OsgiWhiteboardTest.java
index ffef129..469806c 100644
--- a/oak-core-spi/src/test/java/org/apache/jackrabbit/oak/osgi/OsgiWhiteboardTest.java
+++ b/oak-core-spi/src/test/java/org/apache/jackrabbit/oak/osgi/OsgiWhiteboardTest.java
@@ -72,8 +72,8 @@
};
when(
- bundleContext.registerService(Runnable.class.getName(), r,
- new Hashtable<Object, Object>())).thenReturn(sr);
+ bundleContext.registerService(Runnable.class, r,
+ new Hashtable<String, Object>())).thenReturn(sr);
Registration reg = w.register(Runnable.class, r,
new HashMap<String, Object>());
reg.unregister();
diff --git a/oak-core/pom.xml b/oak-core/pom.xml
index aa12056..90b043e 100644
--- a/oak-core/pom.xml
+++ b/oak-core/pom.xml
@@ -213,17 +213,17 @@
<!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>org.osgi.annotation.versioning</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
+ <artifactId>org.osgi.service.component</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/metric/StatisticsProviderFactory.java b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/metric/StatisticsProviderFactory.java
index 6d04f0b..d686d2b 100644
--- a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/metric/StatisticsProviderFactory.java
+++ b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/metric/StatisticsProviderFactory.java
@@ -47,6 +47,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.codahale.metrics.MetricRegistry;
+
/**
* Factory to create StatisticsProvider depending on setup. It detects if the
* <a href="http://metrics.dropwizard.io">Metrics</a> library is present or not. If present
@@ -146,9 +148,9 @@
private StatisticsProvider createMetricsProvider(ScheduledExecutorService executor) {
org.apache.jackrabbit.oak.plugins.metric.MetricStatisticsProvider metricProvider =
new org.apache.jackrabbit.oak.plugins.metric.MetricStatisticsProvider(server, executor);
- Dictionary<Object, Object> dictionary = new Hashtable<Object, Object>();
+ Dictionary<String, Object> dictionary = new Hashtable<>();
dictionary.put("name", "oak");
- regs.add(bundleContext.registerService("com.codahale.metrics.MetricRegistry",
+ regs.add(bundleContext.registerService(MetricRegistry.class,
metricProvider.getRegistry(), dictionary));
return metricProvider;
}
diff --git a/oak-exercise/pom.xml b/oak-exercise/pom.xml
index 95b6656..3803a20 100644
--- a/oak-exercise/pom.xml
+++ b/oak-exercise/pom.xml
@@ -143,7 +143,12 @@
<!-- OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
+ <artifactId>org.osgi.service.component</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.annotation.versioning</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
@@ -159,11 +164,6 @@
<artifactId>org.apache.felix.jaas</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <scope>provided</scope>
- </dependency>
<dependency>
<groupId>org.slf4j</groupId>
diff --git a/oak-http/pom.xml b/oak-http/pom.xml
index 77e1904..df82948 100644
--- a/oak-http/pom.xml
+++ b/oak-http/pom.xml
@@ -48,18 +48,6 @@
</build>
<dependencies>
- <!-- Optional OSGi dependencies, used only when running within OSGi -->
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <scope>provided</scope>
- </dependency>
-
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-shaded-guava</artifactId>
diff --git a/oak-it-osgi/src/test/java/org/apache/jackrabbit/oak/osgi/OSGiIT.java b/oak-it-osgi/src/test/java/org/apache/jackrabbit/oak/osgi/OSGiIT.java
index 896b43e..7d81449 100644
--- a/oak-it-osgi/src/test/java/org/apache/jackrabbit/oak/osgi/OSGiIT.java
+++ b/oak-it-osgi/src/test/java/org/apache/jackrabbit/oak/osgi/OSGiIT.java
@@ -60,10 +60,15 @@
public Option[] configuration() throws IOException, URISyntaxException {
return CoreOptions.options(
junitBundles(),
- mavenBundle("org.apache.felix", "org.apache.felix.scr", "2.0.12"),
+ // require at least DS 1.4 supported by SCR 2.1.0+
+ mavenBundle("org.apache.felix", "org.apache.felix.scr", "2.1.28"),
+ // transitive deps of Felix SCR 2.1.x
+ mavenBundle("org.osgi", "org.osgi.util.promise", "1.1.1"),
+ mavenBundle("org.osgi", "org.osgi.util.function", "1.1.0"),
mavenBundle("org.apache.felix", "org.apache.felix.jaas", "1.0.2"),
mavenBundle("org.osgi", "org.osgi.dto", "1.0.0"),
- mavenBundle( "org.apache.felix", "org.apache.felix.configadmin", "1.8.16" ),
+ // require at least ConfigAdmin 1.6 supported by felix.configadmin 1.9.0+
+ mavenBundle( "org.apache.felix", "org.apache.felix.configadmin", "1.9.20" ),
mavenBundle( "org.apache.felix", "org.apache.felix.fileinstall", "3.2.6" ),
mavenBundle( "org.ops4j.pax.logging", "pax-logging-api", "1.7.2" ),
frameworkProperty("repository.home").value("target"),
diff --git a/oak-jcr/pom.xml b/oak-jcr/pom.xml
index 61d9653..0d6c5f0 100644
--- a/oak-jcr/pom.xml
+++ b/oak-jcr/pom.xml
@@ -189,23 +189,17 @@
</build>
<dependencies>
- <!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>org.osgi.annotation.versioning</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
<!-- somehow the 1.6.0_65 compiler crashes on osx without this. -->
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
diff --git a/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/osgi/RepositoryManager.java b/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/osgi/RepositoryManager.java
index 5e3daf3..e7f3101 100644
--- a/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/osgi/RepositoryManager.java
+++ b/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/osgi/RepositoryManager.java
@@ -18,8 +18,8 @@
*/
package org.apache.jackrabbit.oak.jcr.osgi;
+import java.util.Hashtable;
import java.util.Map;
-import java.util.Properties;
import javax.jcr.Repository;
@@ -31,23 +31,23 @@
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.ReferenceStrategy;
import org.apache.felix.scr.annotations.References;
+import org.apache.jackrabbit.oak.InitialContent;
import org.apache.jackrabbit.oak.Oak;
import org.apache.jackrabbit.oak.commons.PropertiesUtil;
import org.apache.jackrabbit.oak.osgi.OsgiWhiteboard;
import org.apache.jackrabbit.oak.plugins.commit.JcrConflictHandler;
import org.apache.jackrabbit.oak.plugins.index.IndexEditorProvider;
-import org.apache.jackrabbit.oak.InitialContent;
+import org.apache.jackrabbit.oak.plugins.index.WhiteboardIndexEditorProvider;
import org.apache.jackrabbit.oak.plugins.observation.CommitRateLimiter;
import org.apache.jackrabbit.oak.plugins.version.VersionHook;
import org.apache.jackrabbit.oak.spi.commit.BackgroundObserver;
+import org.apache.jackrabbit.oak.spi.commit.WhiteboardEditorProvider;
import org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer;
+import org.apache.jackrabbit.oak.spi.query.WhiteboardIndexProvider;
import org.apache.jackrabbit.oak.spi.security.SecurityProvider;
import org.apache.jackrabbit.oak.spi.state.NodeStore;
import org.apache.jackrabbit.oak.spi.whiteboard.Tracker;
import org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard;
-import org.apache.jackrabbit.oak.spi.commit.WhiteboardEditorProvider;
-import org.apache.jackrabbit.oak.plugins.index.WhiteboardIndexEditorProvider;
-import org.apache.jackrabbit.oak.spi.query.WhiteboardIndexProvider;
import org.apache.jackrabbit.oak.stats.StatisticsProvider;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
@@ -206,6 +206,6 @@
fastQueryResultSize
);
- return bundleContext.registerService(Repository.class.getName(), repository, new Properties());
+ return bundleContext.registerService(Repository.class, repository, new Hashtable<String, Object>());
}
}
diff --git a/oak-lucene/pom.xml b/oak-lucene/pom.xml
index 67bfc39..bd57dbe 100644
--- a/oak-lucene/pom.xml
+++ b/oak-lucene/pom.xml
@@ -152,17 +152,12 @@
<!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
+ <artifactId>org.osgi.annotation.versioning</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/oak-parent/pom.xml b/oak-parent/pom.xml
index 330a587..71e5171 100644
--- a/oak-parent/pom.xml
+++ b/oak-parent/pom.xml
@@ -482,36 +482,52 @@
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <version>4.2.0</version>
+ <artifactId>osgi.core</artifactId>
+ <version>7.0.0</version>
+ </dependency>
+ <!-- OSGi R7 Compendium Specs -->
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.service.component</artifactId>
+ <version>1.4.0</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <version>4.2.0</version>
+ <artifactId>org.osgi.service.metatype</artifactId>
+ <version>1.4.1</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
+ <artifactId>org.osgi.service.cm</artifactId>
+ <version>1.6.1</version>
+ </dependency>
+ <!-- OSGi R7 annotations -->
+ <dependency>
+ <groupId>org.osgi</groupId>
<artifactId>org.osgi.service.component.annotations</artifactId>
- <version>1.3.0</version>
+ <version>1.4.0</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.service.metatype.annotations</artifactId>
- <version>1.3.0</version>
+ <version>1.4.0</version>
</dependency>
-
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.annotation.bundle</artifactId>
+ <version>1.0.0</version><!-- R7 version, https://docs.osgi.org/javadoc/osgi.annotation/7.0.0/org/osgi/annotation/bundle/package-summary.html -->
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.annotation.versioning</artifactId>
+ <version>1.1.2</version><!-- R7 version, https://docs.osgi.org/javadoc/osgi.annotation/7.0.0/org/osgi/annotation/versioning/package-summary.html -->
+ </dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
<version>1.9.6</version>
</dependency>
<dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
- <version>6.0.0</version>
- </dependency>
- <dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>18.0.0</version>
diff --git a/oak-query-spi/pom.xml b/oak-query-spi/pom.xml
index ce82412..4d7107d 100644
--- a/oak-query-spi/pom.xml
+++ b/oak-query-spi/pom.xml
@@ -60,10 +60,9 @@
</build>
<dependencies>
- <!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
+ <artifactId>org.osgi.annotation.versioning</artifactId>
<scope>provided</scope>
</dependency>
diff --git a/oak-search-elastic/pom.xml b/oak-search-elastic/pom.xml
index b332d17..0683ed9 100644
--- a/oak-search-elastic/pom.xml
+++ b/oak-search-elastic/pom.xml
@@ -94,17 +94,12 @@
<!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
+ <artifactId>org.osgi.service.component</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/oak-search-mt/pom.xml b/oak-search-mt/pom.xml
index cea8154..1b730ef 100644
--- a/oak-search-mt/pom.xml
+++ b/oak-search-mt/pom.xml
@@ -84,21 +84,6 @@
<dependencies>
<!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
<scope>provided</scope>
diff --git a/oak-search/pom.xml b/oak-search/pom.xml
index d613c6f..62fdfdd 100644
--- a/oak-search/pom.xml
+++ b/oak-search/pom.xml
@@ -80,17 +80,7 @@
<!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
+ <artifactId>org.osgi.annotation.versioning</artifactId>
<scope>provided</scope>
</dependency>
diff --git a/oak-security-spi/pom.xml b/oak-security-spi/pom.xml
index ccd61ec..086c94c 100644
--- a/oak-security-spi/pom.xml
+++ b/oak-security-spi/pom.xml
@@ -73,17 +73,12 @@
<!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
+ <artifactId>org.osgi.annotation.versioning</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/oak-segment-aws/pom.xml b/oak-segment-aws/pom.xml
index 804d454..eb72e9c 100644
--- a/oak-segment-aws/pom.xml
+++ b/oak-segment-aws/pom.xml
@@ -149,17 +149,12 @@
<!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
+ <artifactId>org.osgi.service.component</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/oak-segment-aws/src/main/java/org/apache/jackrabbit/oak/segment/aws/AwsSegmentStoreService.java b/oak-segment-aws/src/main/java/org/apache/jackrabbit/oak/segment/aws/AwsSegmentStoreService.java
index 9efe03a..66b859d 100644
--- a/oak-segment-aws/src/main/java/org/apache/jackrabbit/oak/segment/aws/AwsSegmentStoreService.java
+++ b/oak-segment-aws/src/main/java/org/apache/jackrabbit/oak/segment/aws/AwsSegmentStoreService.java
@@ -19,7 +19,7 @@
package org.apache.jackrabbit.oak.segment.aws;
import java.io.IOException;
-import java.util.Properties;
+import java.util.Hashtable;
import org.apache.jackrabbit.oak.segment.spi.persistence.SegmentNodeStorePersistence;
import org.osgi.framework.ServiceRegistration;
@@ -47,8 +47,8 @@
@Activate
public void activate(ComponentContext context, Configuration config) throws IOException {
persistence = createAwsPersistence(config);
- registration = context.getBundleContext().registerService(SegmentNodeStorePersistence.class.getName(),
- persistence, new Properties());
+ registration = context.getBundleContext().registerService(SegmentNodeStorePersistence.class,
+ persistence, new Hashtable<String, Object>());
}
@Deactivate
diff --git a/oak-segment-azure/pom.xml b/oak-segment-azure/pom.xml
index 2bf2dbb..7e13737 100644
--- a/oak-segment-azure/pom.xml
+++ b/oak-segment-azure/pom.xml
@@ -102,17 +102,12 @@
<!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
+ <artifactId>org.osgi.service.component</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureSegmentStoreService.java b/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureSegmentStoreService.java
index 0ccf7fe..e76372f 100644
--- a/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureSegmentStoreService.java
+++ b/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureSegmentStoreService.java
@@ -39,6 +39,7 @@
import java.io.IOException;
import java.net.URISyntaxException;
import java.security.InvalidKeyException;
+import java.util.Hashtable;
import java.util.Objects;
import java.util.Properties;
@@ -63,7 +64,7 @@
public void activate(ComponentContext context, Configuration config) throws IOException {
AzurePersistence persistence = createAzurePersistenceFrom(config);
registration = context.getBundleContext()
- .registerService(SegmentNodeStorePersistence.class.getName(), persistence, new Properties() {{
+ .registerService(SegmentNodeStorePersistence.class, persistence, new Hashtable<String, Object>() {{
put(SERVICE_PID, String.format("%s(%s, %s)", AzurePersistence.class.getName(), config.accountName(), config.rootPath()));
if (!Objects.equals(config.role(), "")) {
put("role", config.role());
diff --git a/oak-segment-remote/pom.xml b/oak-segment-remote/pom.xml
index 20b9cf0..2206a96 100644
--- a/oak-segment-remote/pom.xml
+++ b/oak-segment-remote/pom.xml
@@ -78,17 +78,17 @@
<!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>org.osgi.service.component</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
+ <artifactId>org.osgi.annotation.versioning</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/oak-segment-remote/src/main/java/org/apache/jackrabbit/oak/segment/remote/persistentcache/RemotePersistentCacheService.java b/oak-segment-remote/src/main/java/org/apache/jackrabbit/oak/segment/remote/persistentcache/RemotePersistentCacheService.java
index c4c82f2..a9fdd29 100644
--- a/oak-segment-remote/src/main/java/org/apache/jackrabbit/oak/segment/remote/persistentcache/RemotePersistentCacheService.java
+++ b/oak-segment-remote/src/main/java/org/apache/jackrabbit/oak/segment/remote/persistentcache/RemotePersistentCacheService.java
@@ -39,6 +39,7 @@
import java.io.File;
import java.io.IOException;
+import java.util.Hashtable;
import java.util.Properties;
@Component(
@@ -61,7 +62,7 @@
osgiWhiteboard = new OsgiWhiteboard(context.getBundleContext());
persistentCache = createPersistentCache(config, closer);
if (persistentCache != null) {
- registration = context.getBundleContext().registerService(PersistentCache.class.getName(), persistentCache, new Properties());
+ registration = context.getBundleContext().registerService(PersistentCache.class, persistentCache, new Hashtable<String, Object>());
}
}
diff --git a/oak-segment-tar/pom.xml b/oak-segment-tar/pom.xml
index 2a62ee5..006bc57 100644
--- a/oak-segment-tar/pom.xml
+++ b/oak-segment-tar/pom.xml
@@ -257,12 +257,17 @@
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>org.osgi.service.component</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.annotation.versioning</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/standby/store/StandbyStoreService.java b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/standby/store/StandbyStoreService.java
index 20698bf..371aa1f 100644
--- a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/standby/store/StandbyStoreService.java
+++ b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/standby/store/StandbyStoreService.java
@@ -238,10 +238,10 @@
StandbyClientSync standbyClientSync = builder.build();
closer.register(standbyClientSync);
- Dictionary<Object, Object> dictionary = new Hashtable<Object, Object>();
+ Dictionary<String, Object> dictionary = new Hashtable<>();
dictionary.put("scheduler.period", config.interval());
dictionary.put("scheduler.concurrent", false);
- ServiceRegistration registration = context.getBundleContext().registerService(Runnable.class.getName(), standbyClientSync, dictionary);
+ ServiceRegistration registration = context.getBundleContext().registerService(Runnable.class, standbyClientSync, dictionary);
closer.register(registration::unregister);
log.info("Started standby on port {} with {}s sync frequency", config.port(), config.interval());
diff --git a/oak-shaded-guava/pom.xml b/oak-shaded-guava/pom.xml
index 55862e0..cfec2c1 100644
--- a/oak-shaded-guava/pom.xml
+++ b/oak-shaded-guava/pom.xml
@@ -117,11 +117,6 @@
<version>${shaded.guava.version}</version>
</dependency>
<dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
</dependency>
diff --git a/oak-solr-core/pom.xml b/oak-solr-core/pom.xml
index ff5021c..1c59e36 100644
--- a/oak-solr-core/pom.xml
+++ b/oak-solr-core/pom.xml
@@ -216,17 +216,16 @@
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>org.osgi.service.component</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
-
<dependency>
<groupId>javax.jcr</groupId>
<artifactId>jcr</artifactId>
diff --git a/oak-solr-osgi/pom.xml b/oak-solr-osgi/pom.xml
index a6637d0..a4d4f19 100644
--- a/oak-solr-osgi/pom.xml
+++ b/oak-solr-osgi/pom.xml
@@ -89,15 +89,8 @@
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <scope>provided</scope>
- <optional>true</optional>
</dependency>
<dependency>
diff --git a/oak-store-composite/pom.xml b/oak-store-composite/pom.xml
index d0c5694..e9de4e6 100644
--- a/oak-store-composite/pom.xml
+++ b/oak-store-composite/pom.xml
@@ -77,20 +77,19 @@
</build>
<dependencies>
- <!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>org.osgi.service.component</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
+ <artifactId>org.osgi.annotation.versioning</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/oak-store-composite/src/test/java/org/apache/jackrabbit/oak/composite/MountInfoProviderServiceTest.java b/oak-store-composite/src/test/java/org/apache/jackrabbit/oak/composite/MountInfoProviderServiceTest.java
index 12da8a0..8a2e3cc 100644
--- a/oak-store-composite/src/test/java/org/apache/jackrabbit/oak/composite/MountInfoProviderServiceTest.java
+++ b/oak-store-composite/src/test/java/org/apache/jackrabbit/oak/composite/MountInfoProviderServiceTest.java
@@ -20,6 +20,8 @@
package org.apache.jackrabbit.oak.composite;
import org.apache.jackrabbit.guava.common.collect.ImmutableMap;
+
+import java.util.Hashtable;
import java.util.Properties;
import org.apache.jackrabbit.oak.spi.mount.Mount;
import org.apache.jackrabbit.oak.spi.mount.MountInfoProvider;
@@ -185,7 +187,7 @@
private void registerActivateMountInfoConfig(MountInfoConfig.Props mountInfoProps) {
MountInfoConfig mountInfoConfig = new MountInfoConfig();
- context.bundleContext().registerService(MountInfoConfig.class.getName(), mountInfoConfig, new Properties());
+ context.bundleContext().registerService(MountInfoConfig.class, mountInfoConfig, new Hashtable<String, Object>());
mountInfoConfig.activate(context.bundleContext(), mountInfoProps);
}
diff --git a/oak-store-document/pom.xml b/oak-store-document/pom.xml
index b198aa7..81f7bc4 100644
--- a/oak-store-document/pom.xml
+++ b/oak-store-document/pom.xml
@@ -78,20 +78,19 @@
</profiles>
<dependencies>
- <!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>org.osgi.service.component</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation</artifactId>
+ <artifactId>org.osgi.service.cm</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BaseDocumentDiscoveryLiteServiceTest.java b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BaseDocumentDiscoveryLiteServiceTest.java
index e608cac..96d15f5 100644
--- a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BaseDocumentDiscoveryLiteServiceTest.java
+++ b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BaseDocumentDiscoveryLiteServiceTest.java
@@ -22,7 +22,6 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -58,7 +57,6 @@
import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.TestRule;
-import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
@@ -89,7 +87,7 @@
DocumentDiscoveryLiteService service;
DocumentNodeStore ns;
private final Descriptors descriptors;
- private Map<String, Object> registeredServices;
+ private Map<Object, Object> registeredServices;
private final long lastRevInterval;
private volatile boolean lastRevStopped = false;
private volatile boolean writeSimulationStopped = false;
@@ -98,7 +96,7 @@
public String workingDir;
SimplifiedInstance(DocumentDiscoveryLiteService service, DocumentNodeStore ns, Descriptors descriptors,
- Map<String, Object> registeredServices, long lastRevInterval, String workingDir) {
+ Map<Object, Object> registeredServices, long lastRevInterval, String workingDir) {
this.service = service;
this.ns = ns;
this.workingDir = workingDir;
@@ -642,16 +640,13 @@
BundleContext bc = mock(BundleContext.class);
ComponentContext c = mock(ComponentContext.class);
when(c.getBundleContext()).thenReturn(bc);
- final Map<String, Object> registeredServices = new HashMap<String, Object>();
- when(bc.registerService(anyString(), any(), any())).then(new Answer<ServiceRegistration>() {
- @Override
- public ServiceRegistration answer(InvocationOnMock invocation) {
- registeredServices.put((String) invocation.getArguments()[0], invocation.getArguments()[1]);
- return null;
- }
+ final Map<Object, Object> registeredServices = new HashMap();
+ when(bc.registerService(any(Class.class), any(Object.class), any())).then((Answer<ServiceRegistration>) invocation -> {
+ registeredServices.put(invocation.getArguments()[0], invocation.getArguments()[1]);
+ return null;
});
discoveryLite.activate(c);
- Descriptors d = (Descriptors) registeredServices.get(Descriptors.class.getName());
+ Descriptors d = (Descriptors) registeredServices.get(Descriptors.class);
final SimplifiedInstance result = new SimplifiedInstance(discoveryLite, ns, d, registeredServices, 500, workingDir);
allInstances.add(result);
logger.info("Created " + result);
diff --git a/oak-store-spi/pom.xml b/oak-store-spi/pom.xml
index 24f40c5..5a09920 100644
--- a/oak-store-spi/pom.xml
+++ b/oak-store-spi/pom.xml
@@ -69,12 +69,7 @@
<!-- Optional OSGi dependencies, used only when running within OSGi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>