Merge pull request #122 from apache/UNOMI-259-jdk11-support

UNOMI-259 JDK 11 support
diff --git a/api/pom.xml b/api/pom.xml
index 3791122..50024f5 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -30,6 +30,16 @@
     <description>Main API of the Apache Unomi Context server</description>
     <packaging>bundle</packaging>
 
+    <dependencies>
+        <dependency>
+            <groupId>javax.xml.bind</groupId>
+            <artifactId>jaxb-api</artifactId>
+            <version>2.2.11</version>
+            <scope>provided</scope>
+        </dependency>
+
+    </dependencies>
+
     <reporting>
         <plugins>
             <plugin>
@@ -67,4 +77,27 @@
             </plugin>
         </plugins>
     </reporting>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <version>4.2.1</version>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
+                        <Import-Package>
+                            org.jvnet.staxex;resolution:=optional,
+                            org.glassfish.hk2.osgiresourcelocator;resolution:=optional,
+                            javax.activation;resolution:=optional,
+                            com.sun.xml.*;resolution:=optional,
+                            *
+                        </Import-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>
diff --git a/api/src/main/java/org/apache/unomi/api/actions/ActionType.java b/api/src/main/java/org/apache/unomi/api/actions/ActionType.java
index 3affba4..5ff336d 100644
--- a/api/src/main/java/org/apache/unomi/api/actions/ActionType.java
+++ b/api/src/main/java/org/apache/unomi/api/actions/ActionType.java
@@ -17,12 +17,12 @@
 
 package org.apache.unomi.api.actions;
 
-import org.apache.unomi.api.*;
+import org.apache.unomi.api.Metadata;
+import org.apache.unomi.api.MetadataItem;
+import org.apache.unomi.api.Parameter;
 
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlTransient;
-import java.io.Serializable;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * A type definition for {@link Action}s.
diff --git a/itests/pom.xml b/itests/pom.xml
index af2262a..aa7d2ca 100644
--- a/itests/pom.xml
+++ b/itests/pom.xml
@@ -181,7 +181,7 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-failsafe-plugin</artifactId>
-                <version>2.20.1</version>
+                <version>3.0.0-M4</version>
                 <configuration>
                     <includes>
                         <include>**/*AllITs.java</include>
diff --git a/itests/src/test/java/org/apache/unomi/itests/BaseIT.java b/itests/src/test/java/org/apache/unomi/itests/BaseIT.java
index 11e93aa..d1bdd33 100644
--- a/itests/src/test/java/org/apache/unomi/itests/BaseIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/BaseIT.java
@@ -21,11 +21,16 @@
 import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.CoreOptions;
 import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.karaf.container.internal.JavaVersionUtil;
 import org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel;
 import org.ops4j.pax.exam.options.MavenArtifactUrlReference;
 import org.ops4j.pax.exam.options.MavenUrlReference;
+import org.ops4j.pax.exam.options.extra.VMOption;
 
 import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 import java.util.function.Predicate;
 import java.util.function.Supplier;
 
@@ -61,7 +66,9 @@
                 .type("xml")
                 .versionAsInProject();
 
-        return new Option[]{
+        List<Option> options = new ArrayList<>();
+
+        Option[] commonOptions = new Option[]{
                 debugConfiguration("5006", false),
                 karafDistributionConfiguration()
                         .frameworkUrl(karafUrl)
@@ -86,7 +93,7 @@
                 replaceConfigurationFile("data/tmp/testLoginEventCondition.json", new File(
                         "src/test/resources/testLoginEventCondition.json")),
                 keepRuntimeFolder(),
-                configureConsole().ignoreLocalConsole(),
+                // configureConsole().ignoreLocalConsole(),
                 logLevel(LogLevel.INFO),
                 editConfigurationFilePut("etc/org.ops4j.pax.logging.cfg", "log4j2.rootLogger.level", "INFO"),
                 editConfigurationFilePut("etc/org.apache.karaf.features.cfg", "serviceRequirements", "disable"),
@@ -107,6 +114,42 @@
                 CoreOptions.bundleStartLevel(100),
                 CoreOptions.frameworkStartLevel(100)
         };
+
+        options.addAll(Arrays.asList(commonOptions));
+
+        if (JavaVersionUtil.getMajorVersion() >= 9) {
+            Option[] jdk9PlusOptions = new Option[]{
+                    new VMOption("--add-reads=java.xml=java.logging"),
+                    new VMOption("--add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED"),
+                    new VMOption("--patch-module"),
+                    new VMOption("java.base=lib/endorsed/org.apache.karaf.specs.locator-"
+                            + System.getProperty("karaf.version") + ".jar"),
+                    new VMOption("--patch-module"), new VMOption("java.xml=lib/endorsed/org.apache.karaf.specs.java.xml-"
+                    + System.getProperty("karaf.version") + ".jar"),
+                    new VMOption("--add-opens"),
+                    new VMOption("java.base/java.security=ALL-UNNAMED"),
+                    new VMOption("--add-opens"),
+                    new VMOption("java.base/java.net=ALL-UNNAMED"),
+                    new VMOption("--add-opens"),
+                    new VMOption("java.base/java.lang=ALL-UNNAMED"),
+                    new VMOption("--add-opens"),
+                    new VMOption("java.base/java.util=ALL-UNNAMED"),
+                    new VMOption("--add-opens"),
+                    new VMOption("java.naming/javax.naming.spi=ALL-UNNAMED"),
+                    new VMOption("--add-opens"),
+                    new VMOption("java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED"),
+                    new VMOption("--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED"),
+                    new VMOption("--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED"),
+                    new VMOption("--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED"),
+                    new VMOption("--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED"),
+                    new VMOption("-classpath"),
+                    new VMOption("lib/jdk9plus/*" + File.pathSeparator + "lib/boot/*")
+
+            };
+            options.addAll(Arrays.asList(jdk9PlusOptions));
+        }
+
+        return options.toArray(new Option[0]);
     }
 
     protected <T> T keepTrying(String failMessage, Supplier<T> call, Predicate<T> predicate, int timeout, int retries) throws InterruptedException {
diff --git a/kar/src/main/feature/feature.xml b/kar/src/main/feature/feature.xml
index 75a0efb..2665b1e 100644
--- a/kar/src/main/feature/feature.xml
+++ b/kar/src/main/feature/feature.xml
@@ -24,7 +24,7 @@
     <feature description="unomi-kar" version="${project.version}" name="unomi-kar"
              start-level="70">
         <feature>war</feature>
-        <feature>cxf</feature>
+        <feature>cxf-jaxrs</feature>
         <feature>cellar</feature>
         <feature>eventadmin</feature>
         <feature>shell-compat</feature>
@@ -52,6 +52,9 @@
         <bundle start-level="75">mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider/${version.jackson.core}</bundle>
         <bundle start-level="75">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jakarta-regexp/1.4_1</bundle>
         <bundle start-level="75">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.joda-time/2.3_1</bundle>
+        <bundle start-level="75">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxws-api-2.2/2.9.0</bundle>
+        <bundle start-level="75">mvn:javax.annotation/javax.annotation-api/1.3.2</bundle>
+        <bundle start-level="75">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jsr305/${jsr305.bundle.version}</bundle>
 
         <bundle start-level="70" start="false">mvn:org.apache.unomi/unomi-lifecycle-watcher/${project.version}</bundle>
         <bundle start-level="75" start="false">mvn:org.apache.unomi/unomi-api/${project.version}</bundle>
diff --git a/package/pom.xml b/package/pom.xml
index 9121745..d8b0b65 100644
--- a/package/pom.xml
+++ b/package/pom.xml
@@ -327,7 +327,7 @@
                         <feature>service</feature>
                         <feature>system</feature>
                         <feature>war</feature>
-                        <feature>cxf</feature>
+                        <feature>cxf-jaxrs</feature>
                         <feature>cellar</feature>
                         <feature>aries-blueprint</feature>
                         <feature>shell-compat</feature>
@@ -335,6 +335,7 @@
                         <feature>unomi-router-karaf-feature</feature>
                         <feature>unomi-web-tracker-karaf-kar</feature>
                     </bootFeatures>
+                    <!--
                     <libraries>
                         <library>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xerces/${xerces.version};type:=endorsed;export:=true;delegate:=true</library>
                         <library>mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxp-api-1.4/${servicemix.specs.version};type:=endorsed;export:=true</library>
@@ -354,6 +355,7 @@
                         <library>mvn:net.java.dev.jna/jna/${jna.version};type:=boot;export:=false</library>
                         <library>mvn:net.java.dev.jna/jna-platform/${jna.version};type:=boot;export:=false</library>
                     </libraries>
+                    -->
                     <javase>1.8</javase>
                 </configuration>
             </plugin>
diff --git a/performance-tests/src/test/java/org/apache/unomi/performancetests/BasicTest.java b/performance-tests/src/test/java/org/apache/unomi/performancetests/BasicTest.java
index be3d7fe..ceda53b 100644
--- a/performance-tests/src/test/java/org/apache/unomi/performancetests/BasicTest.java
+++ b/performance-tests/src/test/java/org/apache/unomi/performancetests/BasicTest.java
@@ -90,7 +90,9 @@
             localRepository = "";
         }
 
-        return new Option[]{
+        List<Option> options = new ArrayList<>();
+
+        Option[] commonOptions = new Option[]{
                 KarafDistributionOption.debugConfiguration("5005", false),
                 KarafDistributionOption.logLevel(LogLevel.INFO),
                 KarafDistributionOption.editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.localRepository", localRepository),
@@ -111,6 +113,42 @@
 //                wrappedBundle(mavenBundle("com.h2database",
 //                        "h2", "1.4.181"))
         };
+
+        options.addAll(Arrays.asList(commonOptions));
+
+        if (JavaVersionUtil.getMajorVersion() >= 9) {
+            Option[] jdk9PlusOptions = new Option[]{
+                    new VMOption("--add-reads=java.xml=java.logging"),
+                    new VMOption("--add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED"),
+                    new VMOption("--patch-module"),
+                    new VMOption("java.base=lib/endorsed/org.apache.karaf.specs.locator-"
+                            + System.getProperty("karaf.version") + ".jar"),
+                    new VMOption("--patch-module"), new VMOption("java.xml=lib/endorsed/org.apache.karaf.specs.java.xml-"
+                    + System.getProperty("karaf.version") + ".jar"),
+                    new VMOption("--add-opens"),
+                    new VMOption("java.base/java.security=ALL-UNNAMED"),
+                    new VMOption("--add-opens"),
+                    new VMOption("java.base/java.net=ALL-UNNAMED"),
+                    new VMOption("--add-opens"),
+                    new VMOption("java.base/java.lang=ALL-UNNAMED"),
+                    new VMOption("--add-opens"),
+                    new VMOption("java.base/java.util=ALL-UNNAMED"),
+                    new VMOption("--add-opens"),
+                    new VMOption("java.naming/javax.naming.spi=ALL-UNNAMED"),
+                    new VMOption("--add-opens"),
+                    new VMOption("java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED"),
+                    new VMOption("--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED"),
+                    new VMOption("--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED"),
+                    new VMOption("--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED"),
+                    new VMOption("--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED"),
+                    new VMOption("-classpath"),
+                    new VMOption("lib/jdk9plus/*" + File.pathSeparator + "lib/boot/*")
+
+            };
+            options.addAll(Arrays.asList(jdk9PlusOptions));
+        }
+
+        return options.toArray(new Option[0]);
     }
 
     @BenchmarkOptions(benchmarkRounds = 100, warmupRounds = 0, concurrency = 10)
diff --git a/persistence-elasticsearch/core/pom.xml b/persistence-elasticsearch/core/pom.xml
index 69c43fd..5b9d569 100644
--- a/persistence-elasticsearch/core/pom.xml
+++ b/persistence-elasticsearch/core/pom.xml
@@ -133,14 +133,14 @@
         <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-api</artifactId>
-            <version>2.6.2</version>
+            <version>2.12.1</version>
             <scope>compile</scope>
             <optional>true</optional>
         </dependency>
         <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-core</artifactId>
-            <version>2.6.2</version>
+            <version>2.12.1</version>
             <scope>compile</scope>
             <exclusions>
                 <exclusion>
@@ -153,7 +153,7 @@
         <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-1.2-api</artifactId>
-            <version>2.6.2</version>
+            <version>2.12.1</version>
             <scope>compile</scope>
             <exclusions>
                 <exclusion>
@@ -223,6 +223,9 @@
                 <configuration>
                     <instructions>
                         <Import-Package>
+                            org.jctools.queues;resolution:=optional,
+                            org.apache.logging.log4j.util.internal;resolution:=optional,
+                            com.conversantmedia.util.concurrent;resolution:=optional,
                             com.carrotsearch.randomizedtesting;resolution:=optional,
                             com.fasterxml.jackson.*;resolution:=optional,
                             com.google.appengine.api;resolution:=optional,
diff --git a/persistence-elasticsearch/pom.xml b/persistence-elasticsearch/pom.xml
index 9975fa2..2ff1d71 100644
--- a/persistence-elasticsearch/pom.xml
+++ b/persistence-elasticsearch/pom.xml
@@ -16,7 +16,8 @@
   ~ 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">
+<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>
@@ -34,4 +35,23 @@
         <module>core</module>
     </modules>
 
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <version>4.2.1</version>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
+                        <Import-Package>
+                            com.conversantmedia.util.concurrent;resolution:=optional,
+                            *
+                        </Import-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>
diff --git a/plugins/baseplugin/pom.xml b/plugins/baseplugin/pom.xml
index d72a688..0e61331 100644
--- a/plugins/baseplugin/pom.xml
+++ b/plugins/baseplugin/pom.xml
@@ -70,7 +70,7 @@
             <artifactId>ognl</artifactId>
         </dependency>
         <dependency>
-            <groupId>javassist</groupId>
+            <groupId>org.javassist</groupId>
             <artifactId>javassist</artifactId>
         </dependency>
         <dependency>
@@ -105,6 +105,8 @@
                     <instructions>
                         <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
                         <Import-Package>
+                            jdk.internal.module;resolution:=optional,
+                            com.sun.tools.attach;resolution:=optional,
                             javassist;resolution:=optional,
                             !com.sun.jdi*,
                             *
diff --git a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/PropertyConditionEvaluator.java b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/PropertyConditionEvaluator.java
index 6a46c54..bb42aeb 100644
--- a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/PropertyConditionEvaluator.java
+++ b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/PropertyConditionEvaluator.java
@@ -17,10 +17,7 @@
 
 package org.apache.unomi.plugins.baseplugin.conditions;
 
-import ognl.Node;
-import ognl.Ognl;
-import ognl.OgnlContext;
-import ognl.OgnlException;
+import ognl.*;
 import ognl.enhance.ExpressionAccessor;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -36,6 +33,8 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.lang.reflect.Member;
+import java.lang.reflect.Modifier;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.regex.Pattern;
@@ -327,7 +326,7 @@
 
     protected Object getOGNLPropertyValue(Item item, String expression) throws Exception {
         ExpressionAccessor accessor = getPropertyAccessor(item, expression);
-        return accessor != null ? accessor.get((OgnlContext) Ognl.createDefaultContext(null), item) : null;
+        return accessor != null ? accessor.get(getOgnlContext(), item) : null;
     }
 
     private Object getNestedPropertyValue(String expressionPart, Map<String, Object> properties) {
@@ -345,6 +344,27 @@
         }
     }
 
+    private OgnlContext getOgnlContext() {
+        return (OgnlContext) Ognl.createDefaultContext(null, new MemberAccess() {
+            @Override
+            public Object setup(Map context, Object target, Member member, String propertyName) {
+                return null;
+            }
+
+            @Override
+            public void restore(Map context, Object target, Member member, String propertyName, Object state) {
+
+            }
+
+            @Override
+            public boolean isAccessible(Map context, Object target, Member member, String propertyName) {
+                int modifiers = member.getModifiers();
+                boolean result = Modifier.isPublic(modifiers);
+                return result;
+            }
+        });
+    }
+
     private ExpressionAccessor getPropertyAccessor(Item item, String expression) throws Exception {
         ExpressionAccessor accessor = null;
         String clazz = item.getClass().getName();
@@ -361,7 +381,7 @@
             ClassLoader contextCL = current.getContextClassLoader();
             try {
                 current.setContextClassLoader(PropertyConditionEvaluator.class.getClassLoader());
-                Node node = Ognl.compileExpression((OgnlContext) Ognl.createDefaultContext(null), item, expression);
+                Node node = Ognl.compileExpression(getOgnlContext() , item, expression);
                 accessor = node.getAccessor();
             } finally {
                 current.setContextClassLoader(contextCL);
diff --git a/plugins/mail/pom.xml b/plugins/mail/pom.xml
index bed1ffe..1d18d77 100644
--- a/plugins/mail/pom.xml
+++ b/plugins/mail/pom.xml
@@ -51,6 +51,20 @@
     <build>
         <plugins>
             <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
+                        <Import-Package>
+                            javax.activation;resolution:=optional,
+                            *
+                        </Import-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+            <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>build-helper-maven-plugin</artifactId>
                 <executions>
diff --git a/plugins/request/pom.xml b/plugins/request/pom.xml
index 516e787..4cc8f83 100644
--- a/plugins/request/pom.xml
+++ b/plugins/request/pom.xml
@@ -160,6 +160,11 @@
             <scope>test</scope>
         </dependency>
 
+        <dependency>
+            <groupId>javax.annotation</groupId>
+            <artifactId>javax.annotation-api</artifactId>
+            <version>1.3.2</version>
+        </dependency>
     </dependencies>
 
     <build>
diff --git a/pom.xml b/pom.xml
index 50032fd..3e30b82 100644
--- a/pom.xml
+++ b/pom.xml
@@ -64,7 +64,7 @@
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <cxf.version>3.3.2</cxf.version>
+        <cxf.version>3.3.4</cxf.version>
         <version.jackson.core>2.9.10</version.jackson.core>
         <version.jackson.databind>2.9.10.1</version.jackson.databind>
         <version.jackson.jaxb>2.9.10</version.jackson.jaxb>
@@ -73,13 +73,15 @@
         <version.pax.exam>4.13.1</version.pax.exam>
         <elasticsearch.version>7.4.2</elasticsearch.version>
 
-        <maven.compiler.source>1.8</maven.compiler.source>
-        <maven.compiler.target>1.8</maven.compiler.target>
-        <scala.version>2.11.4</scala.version>
+        <java.version>1.8</java.version>
+
+        <maven.compiler.source>${java.version}</maven.compiler.source>
+        <maven.compiler.target>${java.version}</maven.compiler.target>
+        <scala.version>2.12.6</scala.version>
         <encoding>UTF-8</encoding>
 
         <gatling.version>2.1.2</gatling.version>
-        <scala-maven-plugin.version>3.2.0</scala-maven-plugin.version>
+        <scala-maven-plugin.version>4.3.0</scala-maven-plugin.version>
 
         <!-- Librairies for Karaf packaging -->
         <xerces.version>2.11.0_1</xerces.version>
@@ -426,7 +428,7 @@
                     <plugin>
                         <groupId>org.codehaus.mojo</groupId>
                         <artifactId>license-maven-plugin</artifactId>
-                        <version>1.8</version>
+                        <version>2.0.0</version>
                         <configuration>
                             <verbose>false</verbose>
                             <addSvnKeyWords>true</addSvnKeyWords>
@@ -930,12 +932,12 @@
             <dependency>
                 <groupId>ognl</groupId>
                 <artifactId>ognl</artifactId>
-                <version>3.0.11</version>
+                <version>3.2.11</version>
             </dependency>
             <dependency>
-                <groupId>javassist</groupId>
+                <groupId>org.javassist</groupId>
                 <artifactId>javassist</artifactId>
-                <version>3.11.0.GA</version>
+                <version>3.24.1-GA</version>
             </dependency>
             <dependency>
                 <groupId>org.antlr</groupId>
@@ -1104,11 +1106,7 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.2</version>
-                <configuration>
-                    <source>1.8</source>
-                    <target>1.8</target>
-                </configuration>
+                <version>3.8.1</version>
             </plugin>
             <plugin>
                 <groupId>org.apache.felix</groupId>
diff --git a/rest/pom.xml b/rest/pom.xml
index 5188db5..d5dc734 100644
--- a/rest/pom.xml
+++ b/rest/pom.xml
@@ -108,66 +108,17 @@
 
     <profiles>
         <profile>
-            <id>rest-doc</id>
+            <id>rest-doc-jdk8</id>
             <activation>
                 <os>
                     <family>!windows</family>
                 </os>
+                <jdk>
+                    [1.6,1.10)
+                </jdk>
             </activation>
             <build>
                 <plugins>
-                    <!--<plugin>
-                        <groupId>com.sebastian-daschner</groupId>
-                        <artifactId>jaxrs-analyzer-maven-plugin</artifactId>
-                        <version>0.8</version>
-                        <executions>
-                            <execution>
-                                <goals>
-                                    <goal>analyze-jaxrs</goal>
-                                </goals>
-                                <configuration>
-                                    &lt;!&ndash; Available backends are plaintext (default), swagger and asciidoc &ndash;&gt;
-                                    <backend>swagger</backend>
-                                    &lt;!&ndash; Domain of the deployed project, defaults to example.com &ndash;&gt;
-                                    &lt;!&ndash;<deployedDomain>example.com</deployedDomain>&ndash;&gt;
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                    <plugin>
-                        <groupId>com.github.kongchen</groupId>
-                        <artifactId>swagger-maven-plugin</artifactId>
-                        <version>3.1.0</version>
-                        <configuration>
-                            <apiSources>
-                                <apiSource>
-                                    <springmvc>false</springmvc>
-                                    <locations>org.apache.unomi.rest</locations>
-                                    <templatePath>${basedir}/api-doc-template/markdown.hbs</templatePath>
-                                    <outputPath>${basedir}/generated/document.html</outputPath>
-                                    <swaggerDirectory>generated/swagger-ui</swaggerDirectory>
-                                    <info>
-                                        <title>Documentation for Apache Unomi's RESTful API</title>
-                                        <version>${project.version}</version>
-                                    </info>
-                                    <securityDefinitions>
-                                        <securityDefinition>
-                                            <name>MybasicAuth</name>
-                                            <type>basic</type>
-                                        </securityDefinition>
-                                    </securityDefinitions>
-                                </apiSource>
-                            </apiSources>
-                        </configuration>
-                        <executions>
-                            <execution>
-                                <phase>compile</phase>
-                                <goals>
-                                    <goal>generate</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>-->
                     <plugin>
                         <groupId>com.qmino</groupId>
                         <artifactId>miredot-plugin</artifactId>
@@ -278,6 +229,128 @@
                 </plugins>
             </build>
         </profile>
+        <profile>
+            <id>rest-doc-jdk10</id>
+            <activation>
+                <os>
+                    <family>!windows</family>
+                </os>
+                <jdk>
+                    1.10
+                </jdk>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>com.qmino</groupId>
+                        <artifactId>miredot-plugin</artifactId>
+                        <version>2.2.1-Java10</version>
+                        <executions>
+                            <execution>
+                                <goals>
+                                    <goal>restdoc</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                        <configuration>
+                            <licence>cHJvamVjdHxvcmcuYXBhY2hlLnVub21pLnVub21pLXJlc3R8MjAyMC0wMi0yOHx0cnVlfC0xI01Dd0NGQ01pMDRxTFZ6LzJ4SG82MjAranZITnRLYWovQWhRcG4vS01jdTU2NXpOWkRpUzcwQXMrdC96bVdRPT0=</licence>
+                            <output>
+                                <title>Documentation for Apache Unomi's RESTful API ${project.version}</title>
+                                <html>
+                                    <!-- optional html configuration -->
+                                    <location>${project.parent.build.directory}/staging/rest-api-doc</location>
+                                </html>
+                                <raml />
+                            </output>
+                            <restModel>
+                                <restFramework>
+                                    <name>jax-rs</name>
+                                    <cxfServiceConfig>
+                                        <item>src/main/resources/OSGI-INF/blueprint/blueprint.xml</item>
+                                    </cxfServiceConfig>
+                                </restFramework>
+                                <httpStatusCodes>
+                                    <httpStatusCode>
+                                        <httpCode>200</httpCode>
+                                        <document>always</document>
+                                        <defaultMessage>The service call has completed successfully.</defaultMessage>
+                                    </httpStatusCode>
+                                    <httpStatusCode>
+                                        <httpCode>401</httpCode>
+                                        <document>explicit: com.acme.exceptions.AuthorizationException</document>
+                                        <defaultMessage>The user is not authorized to use this service.</defaultMessage>
+                                    </httpStatusCode>
+                                    <httpStatusCode>
+                                        <httpCode>412</httpCode>
+                                        <document>put,post</document>
+                                        <defaultMessage>Invalid JSON/XML input.</defaultMessage>
+                                    </httpStatusCode>
+                                    <httpStatusCode>
+                                        <httpCode>500</httpCode>
+                                        <document>always</document>
+                                        <defaultMessage>The service call has not succeeded.</defaultMessage>
+                                        <sticky>true</sticky> <!-- Document always, even if there is an @statuscode tag -->
+                                    </httpStatusCode>
+                                </httpStatusCodes>
+                                <externalSources>
+                                    <sourceDirs>
+                                        <sourceDir>../api/src/main/java</sourceDir>
+                                    </sourceDirs>
+                                </externalSources>
+                            </restModel>
+                            <analysis>
+                                <checks>
+                                    <JAVADOC_MISSING_SUMMARY>warn</JAVADOC_MISSING_SUMMARY>
+                                    <JAVADOC_MISSING_INTERFACEDOCUMENTATION>warn</JAVADOC_MISSING_INTERFACEDOCUMENTATION>
+                                    <JAVADOC_MISSING_PARAMETER_DOCUMENTATION>warn</JAVADOC_MISSING_PARAMETER_DOCUMENTATION>
+                                    <JAVADOC_MISSING_EXCEPTION_DOCUMENTATION>warn</JAVADOC_MISSING_EXCEPTION_DOCUMENTATION>
+                                    <JAVADOC_MISSING_AUTHORS>ignore</JAVADOC_MISSING_AUTHORS>
+                                    <JAXRS_MISSING_PRODUCES>warn</JAXRS_MISSING_PRODUCES>
+                                    <JAXRS_MISSING_CONSUMES>warn</JAXRS_MISSING_CONSUMES>
+                                    <JAXRS_MISSING_PATH_PARAM>warn</JAXRS_MISSING_PATH_PARAM>
+                                    <REST_UNMAPPED_EXCEPTION>warn</REST_UNMAPPED_EXCEPTION>
+                                    <UNREACHABLE_RESOURCE>warn</UNREACHABLE_RESOURCE>
+                                    <PARTIAL_RESOURCE_OVERLAP>warn</PARTIAL_RESOURCE_OVERLAP>
+                                </checks>
+                            </analysis>
+                        </configuration>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-javadoc-plugin</artifactId>
+                        <configuration>
+                            <tags>
+                                <tag>
+                                    <name>summary</name>
+                                    <placement>a</placement>
+                                    <head>MireDot summary (resource title)</head>
+                                </tag>
+                                <tag>
+                                    <name>title</name>
+                                    <placement>a</placement>
+                                    <head>MireDot title (resource title)</head>
+                                </tag>
+                                <tag>
+                                    <name>servicetag</name>
+                                    <placement>a</placement>
+                                    <head>MireDot resource tag (label)</head>
+                                </tag>
+                                <tag>
+                                    <name>statuscode</name>
+                                    <placement>a</placement>
+                                    <head>MireDot resource status code(s)</head>
+                                </tag>
+                                <tag>
+                                    <name>responseheader</name>
+                                    <placement>a</placement>
+                                    <head>MireDot response header</head>
+                                </tag>
+                            </tags>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
     </profiles>
 
     <build>
diff --git a/rest/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/rest/src/main/resources/OSGI-INF/blueprint/blueprint.xml
index 4390c64..8cc3a8b 100644
--- a/rest/src/main/resources/OSGI-INF/blueprint/blueprint.xml
+++ b/rest/src/main/resources/OSGI-INF/blueprint/blueprint.xml
@@ -18,21 +18,23 @@
 
 <blueprint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
-           xmlns:cxf="http://cxf.apache.org/blueprint/core" xmlns:jaxrs="http://cxf.apache.org/blueprint/jaxrs"
+           xmlns:jaxrs="http://cxf.apache.org/blueprint/jaxrs"
            xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
            xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
   http://cxf.apache.org/blueprint/jaxrs http://cxf.apache.org/schemas/blueprint/jaxrs.xsd
-  http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd
+
   http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd">
     <cm:property-placeholder persistent-id="org.apache.unomi.rest.segmentserviceendpoint"
                              update-strategy="reload">
     </cm:property-placeholder>
 
+    <!--
     <cxf:bus>
         <cxf:features>
             <cxf:logging/>
         </cxf:features>
     </cxf:bus>
+    -->
 
     <bean id="cors-filter" class="org.apache.cxf.rs.security.cors.CrossOriginResourceSharingFilter"/>
     <bean id="jacksonMapper" class="org.apache.unomi.persistence.spi.CustomObjectMapper"/>
diff --git a/services/src/main/java/org/apache/unomi/services/impl/definitions/DefinitionsServiceImpl.java b/services/src/main/java/org/apache/unomi/services/impl/definitions/DefinitionsServiceImpl.java
index ff42612..10cb598 100644
--- a/services/src/main/java/org/apache/unomi/services/impl/definitions/DefinitionsServiceImpl.java
+++ b/services/src/main/java/org/apache/unomi/services/impl/definitions/DefinitionsServiceImpl.java
@@ -241,7 +241,7 @@
         ArrayList<PluginType> pluginTypeArrayList = (ArrayList<PluginType>) pluginTypes.get(bundleContext.getBundle().getBundleId());
         while (predefinedPropertiesEntries.hasMoreElements()) {
             URL predefinedPropertyURL = predefinedPropertiesEntries.nextElement();
-            logger.debug("Found predefined property type at " + predefinedPropertyURL + ", loading... ");
+            logger.debug("Found predefined value type at " + predefinedPropertyURL + ", loading... ");
 
             try {
                 ValueType valueType = CustomObjectMapper.getObjectMapper().readValue(predefinedPropertyURL, ValueType.class);