diff --git a/bundles/org.openhab.core.io.console.karaf/bnd.bnd b/bundles/org.openhab.core.io.console.karaf/bnd.bnd new file mode 100644 index 000000000..ab47b4d35 --- /dev/null +++ b/bundles/org.openhab.core.io.console.karaf/bnd.bnd @@ -0,0 +1 @@ +Karaf-Commands: org.openhab.core.io.console.karaf.internal diff --git a/bundles/org.openhab.core.io.console.karaf/pom.xml b/bundles/org.openhab.core.io.console.karaf/pom.xml index 6a54461a0..776466f76 100644 --- a/bundles/org.openhab.core.io.console.karaf/pom.xml +++ b/bundles/org.openhab.core.io.console.karaf/pom.xml @@ -26,6 +26,12 @@ org.openhab.core.io.console ${project.version} + + org.apache.karaf.wrapper + org.apache.karaf.wrapper.core + ${karaf.compile.version} + provided + diff --git a/bundles/org.openhab.core.io.console.karaf/src/main/java/org/openhab/core/io/console/karaf/internal/CommandWrapper.java b/bundles/org.openhab.core.io.console.karaf/src/main/java/org/openhab/core/io/console/karaf/internal/CommandWrapper.java index 7f87cafbe..c6eec5737 100644 --- a/bundles/org.openhab.core.io.console.karaf/src/main/java/org/openhab/core/io/console/karaf/internal/CommandWrapper.java +++ b/bundles/org.openhab.core.io.console.karaf/src/main/java/org/openhab/core/io/console/karaf/internal/CommandWrapper.java @@ -14,7 +14,6 @@ package org.openhab.core.io.console.karaf.internal; import java.util.Arrays; import java.util.List; -import java.util.stream.Collectors; import org.apache.karaf.shell.api.action.Action; import org.apache.karaf.shell.api.action.lifecycle.Reference; @@ -66,7 +65,7 @@ public class CommandWrapper implements Command, Action { @Override public Object execute(Session session, List argList) throws Exception { - String[] args = argList.stream().map(a -> a.toString()).collect(Collectors.toList()).toArray(new String[0]); + String[] args = argList.stream().map(Object::toString).toArray(String[]::new); final Console console = new OSGiConsole(getScope(), session.getConsole()); diff --git a/bundles/org.openhab.core.karaf/src/main/java/org/openhab/core/karaf/internal/command/InstallServiceCommand.java b/bundles/org.openhab.core.io.console.karaf/src/main/java/org/openhab/core/io/console/karaf/internal/InstallServiceCommand.java similarity index 99% rename from bundles/org.openhab.core.karaf/src/main/java/org/openhab/core/karaf/internal/command/InstallServiceCommand.java rename to bundles/org.openhab.core.io.console.karaf/src/main/java/org/openhab/core/io/console/karaf/internal/InstallServiceCommand.java index 1825d5d60..46e7c543a 100644 --- a/bundles/org.openhab.core.karaf/src/main/java/org/openhab/core/karaf/internal/command/InstallServiceCommand.java +++ b/bundles/org.openhab.core.io.console.karaf/src/main/java/org/openhab/core/io/console/karaf/internal/InstallServiceCommand.java @@ -10,7 +10,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.openhab.core.karaf.internal.command; +package org.openhab.core.io.console.karaf.internal; import static org.apache.karaf.shell.support.ansi.SimpleAnsi.*; diff --git a/bundles/org.openhab.core.karaf/bnd.bnd b/bundles/org.openhab.core.karaf/bnd.bnd deleted file mode 100644 index 9d274ed61..000000000 --- a/bundles/org.openhab.core.karaf/bnd.bnd +++ /dev/null @@ -1,2 +0,0 @@ -Bundle-SymbolicName: ${project.artifactId} -Karaf-Commands: org.openhab.core.karaf.internal.command diff --git a/bundles/org.openhab.core.karaf/pom.xml b/bundles/org.openhab.core.karaf/pom.xml index 0b25992dd..3e14f4f1c 100644 --- a/bundles/org.openhab.core.karaf/pom.xml +++ b/bundles/org.openhab.core.karaf/pom.xml @@ -43,12 +43,6 @@ ${karaf.compile.version} provided - - org.apache.karaf.wrapper - org.apache.karaf.wrapper.core - ${karaf.compile.version} - provided - org.apache.karaf.jaas org.apache.karaf.jaas.modules diff --git a/features/karaf/openhab-core/src/main/feature/feature.xml b/features/karaf/openhab-core/src/main/feature/feature.xml index 2883d6b26..fa9dbe440 100644 --- a/features/karaf/openhab-core/src/main/feature/feature.xml +++ b/features/karaf/openhab-core/src/main/feature/feature.xml @@ -116,6 +116,7 @@ openhab-core-base shell + service-wrapper mvn:org.openhab.core.bundles/org.openhab.core.io.console.karaf/${project.version} diff --git a/tools/static-code-analysis/pmd/suppressions.properties b/tools/static-code-analysis/pmd/suppressions.properties index 6ad955a43..6ee882d6a 100644 --- a/tools/static-code-analysis/pmd/suppressions.properties +++ b/tools/static-code-analysis/pmd/suppressions.properties @@ -14,4 +14,4 @@ org.openhab.core.ui.internal.proxy.ProxyServletService=AvoidCatchingThrowable org.openhab.core.automation.internal.RuleEngineImpl=AvoidCatchingThrowable org.openhab.core.automation.internal.RuleRegistryImpl=CompareObjectsWithEquals org.openhab.core.automation.internal.provider.AutomationResourceBundlesEventQueue=AvoidCatchingThrowable -org.openhab.core.karaf.internal.command.InstallServiceCommand=SystemPrintln +org.openhab.core.io.console.karaf.internal.InstallServiceCommand=SystemPrintln