Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "openhab --help" and "help openhab" in Karaf console #2953

Merged
merged 2 commits into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions bundles/org.openhab.core.io.console.karaf/bnd.bnd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Karaf-Commands: org.openhab.core.io.console.karaf.internal
6 changes: 6 additions & 0 deletions bundles/org.openhab.core.io.console.karaf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
<artifactId>org.openhab.core.io.console</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.karaf.wrapper</groupId>
<artifactId>org.apache.karaf.wrapper.core</artifactId>
<version>${karaf.compile.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

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;
Expand Down Expand Up @@ -66,7 +65,7 @@ public CommandWrapper(final ConsoleCommandExtension command) {

@Override
public Object execute(Session session, List<Object> 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());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.*;

Expand Down
2 changes: 0 additions & 2 deletions bundles/org.openhab.core.karaf/bnd.bnd

This file was deleted.

6 changes: 0 additions & 6 deletions bundles/org.openhab.core.karaf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@
<version>${karaf.compile.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.karaf.wrapper</groupId>
<artifactId>org.apache.karaf.wrapper.core</artifactId>
<version>${karaf.compile.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.karaf.jaas</groupId>
<artifactId>org.apache.karaf.jaas.modules</artifactId>
Expand Down
1 change: 1 addition & 0 deletions features/karaf/openhab-core/src/main/feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
<feature name="openhab-core-io-console-karaf" description="Karaf Console support for SmartHome stuff" version="${project.version}">
<feature>openhab-core-base</feature>
<feature>shell</feature>
<feature>service-wrapper</feature>
<bundle>mvn:org.openhab.core.bundles/org.openhab.core.io.console.karaf/${project.version}</bundle>
</feature>

Expand Down
2 changes: 1 addition & 1 deletion tools/static-code-analysis/pmd/suppressions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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