This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch karaf-4.4.x in repository https://gitbox.apache.org/repos/asf/karaf.git
The following commit(s) were added to refs/heads/karaf-4.4.x by this push: new 26e01debc1 KARAF-7775: Move config shell commands in a dedicated bundle 26e01debc1 is described below commit 26e01debc1add5e7b88bb9a4d28adcf14f1450a8 Author: JB Onofré <j...@nanthrax.net> AuthorDate: Wed Jan 3 17:11:05 2024 +0100 KARAF-7775: Move config shell commands in a dedicated bundle (cherry picked from commit 43fcb6175483864dd7e5e5d4be0e4f9e2963424b) --- .../framework/src/main/feature/feature.xml | 2 + .../features/standard/src/main/feature/feature.xml | 4 +- config/{ => command}/pom.xml | 56 +++------ .../apache/karaf/config/command/CancelCommand.java | 0 .../karaf/config/command/ConfigCommandSupport.java | 0 .../command/ConfigPropertyCommandSupport.java | 2 +- .../apache/karaf/config/command/DeleteCommand.java | 0 .../apache/karaf/config/command/EditCommand.java | 2 +- .../apache/karaf/config/command/ExistsCommand.java | 0 .../karaf/config/command/InstallCommand.java | 0 .../apache/karaf/config/command/ListCommand.java | 0 .../apache/karaf/config/command/MetaCommand.java | 9 +- .../karaf/config/command/PropAppendCommand.java | 2 +- .../karaf/config/command/PropDelCommand.java | 0 .../karaf/config/command/PropGetCommand.java | 2 +- .../karaf/config/command/PropListCommand.java | 0 .../karaf/config/command/PropSetCommand.java | 2 +- .../apache/karaf/config/command/UpdateCommand.java | 0 .../command/completers/ConfigurationCompleter.java | 0 .../completers/ConfigurationPropertyCompleter.java | 7 +- .../config/command/completers/MetaCompleter.java | 2 +- .../src/main/resources/OSGI-INF/bundle.info | 0 .../src/main/resources}/command/edit.txt | 0 .../karaf/config/command/EditCommandTest.java | 0 .../karaf/config/command/MockCommandSession.java | 0 .../karaf/config/command/UpdateCommandTest.java | 0 config/{ => core}/pom.xml | 7 +- .../org/apache/karaf/config/core/ConfigMBean.java | 0 .../apache/karaf/config/core/ConfigRepository.java | 0 .../karaf/config/core}/MetaServiceCaller.java | 2 +- .../karaf/config/core/impl/ConfigMBeanImpl.java | 0 .../config/core/impl/ConfigRepositoryImpl.java | 0 .../config/core/impl/JsonConfigInstaller.java | 0 .../config/core/impl/KarafConfigurationPlugin.java | 0 .../karaf/config/core/impl/osgi/Activator.java | 0 .../OSGI-INF/metatype/metatype.properties | 4 +- .../main/resources/OSGI-INF/metatype/metatype.xml | 0 .../config/core/impl/ConfigMBeanImplTest.java | 0 .../core/impl/FelixFileInstallFilenameTest.java | 0 .../config/core/impl/JsonConfigInstallerTest.java | 0 .../core/impl/KarafConfigurationPluginTest.java | 0 .../org.example.Arrays~no_update_required.cfg.json | 0 .../org.example.Arrays~update_required.cfg.json | 0 config/{ => core}/src/test/resources/test.cfg | 0 config/pom.xml | 140 ++------------------- 45 files changed, 45 insertions(+), 198 deletions(-) diff --git a/assemblies/features/framework/src/main/feature/feature.xml b/assemblies/features/framework/src/main/feature/feature.xml index d339d8555d..a30ae6c578 100644 --- a/assemblies/features/framework/src/main/feature/feature.xml +++ b/assemblies/features/framework/src/main/feature/feature.xml @@ -33,6 +33,7 @@ <!-- config admin --> <bundle start-level="9">mvn:org.osgi/org.osgi.util.function/${org.osgi.util.function.version}</bundle> <bundle start-level="9">mvn:org.osgi/org.osgi.util.promise/${org.osgi.util.promise.version}</bundle> + <bundle start-level="9">mvn:org.apache.felix/org.apache.felix.metatype/${felix.metatype.version}</bundle> <bundle start-level="9">mvn:org.apache.felix/org.apache.felix.coordinator/${felix.coordinator.version}</bundle> <bundle start-level="9">mvn:org.apache.felix/org.apache.felix.converter/${felix.converter.version}</bundle> <bundle start-level="10">mvn:org.apache.felix/org.apache.felix.configadmin/${felix.configadmin.version}</bundle> @@ -59,6 +60,7 @@ <!-- config admin --> <bundle start-level="9">mvn:org.osgi/org.osgi.util.function/${org.osgi.util.function.version}</bundle> <bundle start-level="9">mvn:org.osgi/org.osgi.util.promise/${org.osgi.util.promise.version}</bundle> + <bundle start-level="9">mvn:org.apache.felix/org.apache.felix.metatype/${felix.metatype.version}</bundle> <bundle start-level="9">mvn:org.apache.felix/org.apache.felix.coordinator/${felix.coordinator.version}</bundle> <bundle start-level="9">mvn:org.apache.felix/org.apache.felix.converter/${felix.converter.version}</bundle> <bundle start-level="10">mvn:org.apache.felix/org.apache.felix.configadmin/${felix.configadmin.version}</bundle> diff --git a/assemblies/features/standard/src/main/feature/feature.xml b/assemblies/features/standard/src/main/feature/feature.xml index 183d91ab4d..462b177562 100644 --- a/assemblies/features/standard/src/main/feature/feature.xml +++ b/assemblies/features/standard/src/main/feature/feature.xml @@ -630,6 +630,7 @@ property-set[/.*org[.]apache[.]karaf[.]command[.]acl[.].+/] = admin property-set[/.*org[.]apache[.]karaf[.]service[.]acl[.].+/] = admin update = manager </config> + <bundle start-level="30">mvn:org.apache.karaf.config/org.apache.karaf.config.command/${project.version}</bundle> </conditional> </feature> @@ -978,7 +979,6 @@ realm=karaf # The role required to access the WebConsole role=admin </config> - <bundle start-level="30">mvn:org.apache.felix/org.apache.felix.metatype/${felix.metatype.version}</bundle> <bundle start-level="30">mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.console/${project.version}</bundle> <bundle start-level="30">mvn:org.apache.felix/org.apache.felix.webconsole.plugins.memoryusage/${felix.memoryusage.webconsole.plugin.version}</bundle> <conditional> @@ -1429,7 +1429,6 @@ org.quartz.jobStore.class=org.quartz.simpl.RAMJobStore org.apache.felix.eventadmin.AddTimestamp=true org.apache.felix.eventadmin.AddSubject=true </config> - <bundle start-level="5">mvn:org.apache.felix/org.apache.felix.metatype/${felix.metatype.version}</bundle> <bundle start-level="5">mvn:org.apache.karaf.services/org.apache.karaf.services.eventadmin/${project.version}</bundle> <conditional> <condition>shell</condition> @@ -1468,7 +1467,6 @@ org.apache.felix.eventadmin.AddSubject=true <bundle dependency="true" start-level="30">mvn:org.osgi/org.osgi.util.function/${org.osgi.util.function.version}</bundle> <bundle dependency="true" start-level="30">mvn:org.osgi/org.osgi.util.promise/${org.osgi.util.promise.version}</bundle> <bundle dependency="true" start-level="30">mvn:org.osgi/org.osgi.service.component/${org.osgi.service.component.version}</bundle> - <bundle dependency="true" start-level="30">mvn:org.apache.felix/org.apache.felix.metatype/${felix.metatype.version}</bundle> <bundle start-level="30">mvn:org.apache.felix/org.apache.felix.scr/${felix.scr.version}</bundle> <conditional> <condition>management</condition> diff --git a/config/pom.xml b/config/command/pom.xml similarity index 69% copy from config/pom.xml copy to config/command/pom.xml index a268df7d99..b0d37b38dd 100644 --- a/config/pom.xml +++ b/config/command/pom.xml @@ -22,17 +22,17 @@ <modelVersion>4.0.0</modelVersion> <parent> - <groupId>org.apache.karaf</groupId> - <artifactId>karaf</artifactId> + <groupId>org.apache.karaf.config</groupId> + <artifactId>config</artifactId> <version>4.4.5-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <groupId>org.apache.karaf.config</groupId> - <artifactId>org.apache.karaf.config.core</artifactId> + <artifactId>org.apache.karaf.config.command</artifactId> <packaging>bundle</packaging> - <name>Apache Karaf :: ConfigAdmin :: Core</name> - <description>This bundle provides Karaf services</description> + <name>Apache Karaf :: ConfigAdmin :: Command</name> + <description>This bundle provides Karaf Config shell commands</description> <properties> <appendedResourcesDirectory>${basedir}/../etc/appended-resources</appendedResourcesDirectory> @@ -66,38 +66,15 @@ <artifactId>org.osgi.service.metatype</artifactId> <scope>provided</scope> </dependency> - <dependency> - <groupId>org.osgi</groupId> - <artifactId>org.osgi.util.converter</artifactId> - <version>1.0.9</version> - <scope>provided</scope> - </dependency> - - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - </dependency> - <dependency> - <groupId>org.apache.karaf</groupId> - <artifactId>org.apache.karaf.util</artifactId> - </dependency> <dependency> <groupId>org.apache.felix</groupId> - <artifactId>org.apache.felix.cm.json</artifactId> - </dependency> - <dependency> - <groupId>org.apache.sling</groupId> - <artifactId>org.apache.sling.commons.johnzon</artifactId> - </dependency> - <dependency> - <groupId>org.apache.geronimo.specs</groupId> - <artifactId>geronimo-json_1.1_spec</artifactId> - <version>1.5</version> + <artifactId>org.apache.felix.utils</artifactId> </dependency> + <dependency> - <groupId>org.apache.felix</groupId> - <artifactId>org.apache.felix.fileinstall</artifactId> + <groupId>org.apache.karaf.config</groupId> + <artifactId>org.apache.karaf.config.core</artifactId> </dependency> <dependency> @@ -140,21 +117,18 @@ <configuration> <instructions> <Export-Package> - org.apache.karaf.config.command*, - org.apache.karaf.config.core, - org.apache.felix.utils.properties;version="${felix.utils.version}" + org.apache.karaf.config.command* </Export-Package> <Import-Package> - org.osgi.service.metatype;resolution:=optional, + !org.apache.karaf.config.command, + !org.apache.karaf.config.command.completers, + org.apache.felix.utils.properties, org.osgi.framework;version="[1,3)", + org.apache.karaf.config.core*, * </Import-Package> <Private-Package> - org.apache.karaf.config.core.impl, - org.apache.karaf.config.core.impl.osgi, - org.apache.karaf.util, - org.apache.karaf.util.config, - org.apache.felix.utils.collections + org.apache.karaf.util </Private-Package> </instructions> </configuration> diff --git a/config/src/main/java/org/apache/karaf/config/command/CancelCommand.java b/config/command/src/main/java/org/apache/karaf/config/command/CancelCommand.java similarity index 100% rename from config/src/main/java/org/apache/karaf/config/command/CancelCommand.java rename to config/command/src/main/java/org/apache/karaf/config/command/CancelCommand.java diff --git a/config/src/main/java/org/apache/karaf/config/command/ConfigCommandSupport.java b/config/command/src/main/java/org/apache/karaf/config/command/ConfigCommandSupport.java similarity index 100% rename from config/src/main/java/org/apache/karaf/config/command/ConfigCommandSupport.java rename to config/command/src/main/java/org/apache/karaf/config/command/ConfigCommandSupport.java diff --git a/config/src/main/java/org/apache/karaf/config/command/ConfigPropertyCommandSupport.java b/config/command/src/main/java/org/apache/karaf/config/command/ConfigPropertyCommandSupport.java similarity index 100% rename from config/src/main/java/org/apache/karaf/config/command/ConfigPropertyCommandSupport.java rename to config/command/src/main/java/org/apache/karaf/config/command/ConfigPropertyCommandSupport.java index 533ea933cc..18d880482b 100644 --- a/config/src/main/java/org/apache/karaf/config/command/ConfigPropertyCommandSupport.java +++ b/config/command/src/main/java/org/apache/karaf/config/command/ConfigPropertyCommandSupport.java @@ -16,8 +16,8 @@ */ package org.apache.karaf.config.command; -import org.apache.felix.utils.properties.TypedProperties; import org.apache.karaf.config.command.completers.ConfigurationCompleter; +import org.apache.felix.utils.properties.TypedProperties; import org.apache.karaf.shell.api.action.Completion; import org.apache.karaf.shell.api.action.Option; diff --git a/config/src/main/java/org/apache/karaf/config/command/DeleteCommand.java b/config/command/src/main/java/org/apache/karaf/config/command/DeleteCommand.java similarity index 100% rename from config/src/main/java/org/apache/karaf/config/command/DeleteCommand.java rename to config/command/src/main/java/org/apache/karaf/config/command/DeleteCommand.java diff --git a/config/src/main/java/org/apache/karaf/config/command/EditCommand.java b/config/command/src/main/java/org/apache/karaf/config/command/EditCommand.java similarity index 100% rename from config/src/main/java/org/apache/karaf/config/command/EditCommand.java rename to config/command/src/main/java/org/apache/karaf/config/command/EditCommand.java index fe3d1b2e0e..465421709a 100644 --- a/config/src/main/java/org/apache/karaf/config/command/EditCommand.java +++ b/config/command/src/main/java/org/apache/karaf/config/command/EditCommand.java @@ -16,8 +16,8 @@ */ package org.apache.karaf.config.command; -import org.apache.felix.utils.properties.TypedProperties; import org.apache.karaf.config.command.completers.ConfigurationCompleter; +import org.apache.felix.utils.properties.TypedProperties; import org.apache.karaf.shell.api.action.Argument; import org.apache.karaf.shell.api.action.Command; import org.apache.karaf.shell.api.action.Completion; diff --git a/config/src/main/java/org/apache/karaf/config/command/ExistsCommand.java b/config/command/src/main/java/org/apache/karaf/config/command/ExistsCommand.java similarity index 100% rename from config/src/main/java/org/apache/karaf/config/command/ExistsCommand.java rename to config/command/src/main/java/org/apache/karaf/config/command/ExistsCommand.java diff --git a/config/src/main/java/org/apache/karaf/config/command/InstallCommand.java b/config/command/src/main/java/org/apache/karaf/config/command/InstallCommand.java similarity index 100% rename from config/src/main/java/org/apache/karaf/config/command/InstallCommand.java rename to config/command/src/main/java/org/apache/karaf/config/command/InstallCommand.java diff --git a/config/src/main/java/org/apache/karaf/config/command/ListCommand.java b/config/command/src/main/java/org/apache/karaf/config/command/ListCommand.java similarity index 100% rename from config/src/main/java/org/apache/karaf/config/command/ListCommand.java rename to config/command/src/main/java/org/apache/karaf/config/command/ListCommand.java diff --git a/config/src/main/java/org/apache/karaf/config/command/MetaCommand.java b/config/command/src/main/java/org/apache/karaf/config/command/MetaCommand.java similarity index 96% rename from config/src/main/java/org/apache/karaf/config/command/MetaCommand.java rename to config/command/src/main/java/org/apache/karaf/config/command/MetaCommand.java index 165aea3d6a..fc552f67bd 100644 --- a/config/src/main/java/org/apache/karaf/config/command/MetaCommand.java +++ b/config/command/src/main/java/org/apache/karaf/config/command/MetaCommand.java @@ -16,8 +16,6 @@ */ package org.apache.karaf.config.command; -import static org.apache.karaf.config.core.impl.MetaServiceCaller.doWithMetaType; - import java.io.IOException; import java.util.Dictionary; import java.util.HashMap; @@ -27,7 +25,8 @@ import java.util.Optional; import java.util.function.Function; import org.apache.karaf.config.command.completers.MetaCompleter; -import org.apache.karaf.config.core.impl.MetaServiceCaller.MetaInfo; +import org.apache.karaf.config.core.MetaServiceCaller; +import org.apache.karaf.config.core.MetaServiceCaller.MetaInfo; import org.apache.karaf.shell.api.action.Argument; import org.apache.karaf.shell.api.action.Command; import org.apache.karaf.shell.api.action.Completion; @@ -76,9 +75,9 @@ public class MetaCommand extends ConfigCommandSupport { public Object doExecute() throws Exception { try { if (create) { - doWithMetaType(context, pid, new Create()); + MetaServiceCaller.doWithMetaType(context, pid, new Create()); } else { - doWithMetaType(context, pid, new Print()); + MetaServiceCaller.doWithMetaType(context, pid, new Print()); } return null; } catch (Throwable e) { diff --git a/config/src/main/java/org/apache/karaf/config/command/PropAppendCommand.java b/config/command/src/main/java/org/apache/karaf/config/command/PropAppendCommand.java similarity index 100% rename from config/src/main/java/org/apache/karaf/config/command/PropAppendCommand.java rename to config/command/src/main/java/org/apache/karaf/config/command/PropAppendCommand.java index 6b004315ac..9c05818c01 100644 --- a/config/src/main/java/org/apache/karaf/config/command/PropAppendCommand.java +++ b/config/command/src/main/java/org/apache/karaf/config/command/PropAppendCommand.java @@ -18,8 +18,8 @@ package org.apache.karaf.config.command; import java.util.Collection; -import org.apache.felix.utils.properties.TypedProperties; import org.apache.karaf.config.command.completers.ConfigurationPropertyCompleter; +import org.apache.felix.utils.properties.TypedProperties; import org.apache.karaf.shell.api.action.Argument; import org.apache.karaf.shell.api.action.Command; import org.apache.karaf.shell.api.action.Completion; diff --git a/config/src/main/java/org/apache/karaf/config/command/PropDelCommand.java b/config/command/src/main/java/org/apache/karaf/config/command/PropDelCommand.java similarity index 100% rename from config/src/main/java/org/apache/karaf/config/command/PropDelCommand.java rename to config/command/src/main/java/org/apache/karaf/config/command/PropDelCommand.java diff --git a/config/src/main/java/org/apache/karaf/config/command/PropGetCommand.java b/config/command/src/main/java/org/apache/karaf/config/command/PropGetCommand.java similarity index 100% rename from config/src/main/java/org/apache/karaf/config/command/PropGetCommand.java rename to config/command/src/main/java/org/apache/karaf/config/command/PropGetCommand.java index 48d453ea8d..968602ee02 100644 --- a/config/src/main/java/org/apache/karaf/config/command/PropGetCommand.java +++ b/config/command/src/main/java/org/apache/karaf/config/command/PropGetCommand.java @@ -16,8 +16,8 @@ */ package org.apache.karaf.config.command; -import org.apache.felix.utils.properties.TypedProperties; import org.apache.karaf.config.command.completers.ConfigurationPropertyCompleter; +import org.apache.felix.utils.properties.TypedProperties; import org.apache.karaf.shell.api.action.Argument; import org.apache.karaf.shell.api.action.Command; import org.apache.karaf.shell.api.action.Completion; diff --git a/config/src/main/java/org/apache/karaf/config/command/PropListCommand.java b/config/command/src/main/java/org/apache/karaf/config/command/PropListCommand.java similarity index 100% rename from config/src/main/java/org/apache/karaf/config/command/PropListCommand.java rename to config/command/src/main/java/org/apache/karaf/config/command/PropListCommand.java diff --git a/config/src/main/java/org/apache/karaf/config/command/PropSetCommand.java b/config/command/src/main/java/org/apache/karaf/config/command/PropSetCommand.java similarity index 100% rename from config/src/main/java/org/apache/karaf/config/command/PropSetCommand.java rename to config/command/src/main/java/org/apache/karaf/config/command/PropSetCommand.java index 1108bda67d..77f5549840 100644 --- a/config/src/main/java/org/apache/karaf/config/command/PropSetCommand.java +++ b/config/command/src/main/java/org/apache/karaf/config/command/PropSetCommand.java @@ -16,8 +16,8 @@ */ package org.apache.karaf.config.command; -import org.apache.felix.utils.properties.TypedProperties; import org.apache.karaf.config.command.completers.ConfigurationPropertyCompleter; +import org.apache.felix.utils.properties.TypedProperties; import org.apache.karaf.shell.api.action.Argument; import org.apache.karaf.shell.api.action.Command; import org.apache.karaf.shell.api.action.Completion; diff --git a/config/src/main/java/org/apache/karaf/config/command/UpdateCommand.java b/config/command/src/main/java/org/apache/karaf/config/command/UpdateCommand.java similarity index 100% rename from config/src/main/java/org/apache/karaf/config/command/UpdateCommand.java rename to config/command/src/main/java/org/apache/karaf/config/command/UpdateCommand.java diff --git a/config/src/main/java/org/apache/karaf/config/command/completers/ConfigurationCompleter.java b/config/command/src/main/java/org/apache/karaf/config/command/completers/ConfigurationCompleter.java similarity index 100% rename from config/src/main/java/org/apache/karaf/config/command/completers/ConfigurationCompleter.java rename to config/command/src/main/java/org/apache/karaf/config/command/completers/ConfigurationCompleter.java diff --git a/config/src/main/java/org/apache/karaf/config/command/completers/ConfigurationPropertyCompleter.java b/config/command/src/main/java/org/apache/karaf/config/command/completers/ConfigurationPropertyCompleter.java similarity index 96% rename from config/src/main/java/org/apache/karaf/config/command/completers/ConfigurationPropertyCompleter.java rename to config/command/src/main/java/org/apache/karaf/config/command/completers/ConfigurationPropertyCompleter.java index b42a0cf1a0..9ae225158f 100644 --- a/config/src/main/java/org/apache/karaf/config/command/completers/ConfigurationPropertyCompleter.java +++ b/config/command/src/main/java/org/apache/karaf/config/command/completers/ConfigurationPropertyCompleter.java @@ -19,8 +19,6 @@ package org.apache.karaf.config.command.completers; -import static org.apache.karaf.config.core.impl.MetaServiceCaller.doWithMetaType; - import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; @@ -33,7 +31,8 @@ import java.util.Optional; import java.util.Set; import org.apache.karaf.config.command.ConfigCommandSupport; -import org.apache.karaf.config.core.impl.MetaServiceCaller.MetaInfo; +import org.apache.karaf.config.core.MetaServiceCaller; +import org.apache.karaf.config.core.MetaServiceCaller.MetaInfo; import org.apache.karaf.shell.api.action.lifecycle.Reference; import org.apache.karaf.shell.api.action.lifecycle.Service; import org.apache.karaf.shell.api.console.CommandLine; @@ -142,7 +141,7 @@ public class ConfigurationPropertyCompleter implements Completer { private List<String> getMetaTypeProperties(String pid){ try { - return doWithMetaType(context, pid, this::collectMetaConfigProperties); + return MetaServiceCaller.doWithMetaType(context, pid, this::collectMetaConfigProperties); } catch (Throwable e) { Throwable ncdfe = e; while (ncdfe != null && !(ncdfe instanceof NoClassDefFoundError)) { diff --git a/config/src/main/java/org/apache/karaf/config/command/completers/MetaCompleter.java b/config/command/src/main/java/org/apache/karaf/config/command/completers/MetaCompleter.java similarity index 98% rename from config/src/main/java/org/apache/karaf/config/command/completers/MetaCompleter.java rename to config/command/src/main/java/org/apache/karaf/config/command/completers/MetaCompleter.java index c35ccde1a8..3df9e1e26a 100644 --- a/config/src/main/java/org/apache/karaf/config/command/completers/MetaCompleter.java +++ b/config/command/src/main/java/org/apache/karaf/config/command/completers/MetaCompleter.java @@ -18,7 +18,7 @@ package org.apache.karaf.config.command.completers; import java.util.List; -import org.apache.karaf.config.core.impl.MetaServiceCaller; +import org.apache.karaf.config.core.MetaServiceCaller; import org.apache.karaf.shell.api.action.lifecycle.Init; import org.apache.karaf.shell.api.action.lifecycle.Reference; import org.apache.karaf.shell.api.action.lifecycle.Service; diff --git a/config/src/main/resources/OSGI-INF/bundle.info b/config/command/src/main/resources/OSGI-INF/bundle.info similarity index 100% rename from config/src/main/resources/OSGI-INF/bundle.info rename to config/command/src/main/resources/OSGI-INF/bundle.info diff --git a/config/src/main/resources/org/apache/karaf/config/command/edit.txt b/config/command/src/main/resources/command/edit.txt similarity index 100% rename from config/src/main/resources/org/apache/karaf/config/command/edit.txt rename to config/command/src/main/resources/command/edit.txt diff --git a/config/src/test/java/org/apache/karaf/config/command/EditCommandTest.java b/config/command/src/test/java/org/apache/karaf/config/command/EditCommandTest.java similarity index 100% rename from config/src/test/java/org/apache/karaf/config/command/EditCommandTest.java rename to config/command/src/test/java/org/apache/karaf/config/command/EditCommandTest.java diff --git a/config/src/test/java/org/apache/karaf/config/command/MockCommandSession.java b/config/command/src/test/java/org/apache/karaf/config/command/MockCommandSession.java similarity index 100% rename from config/src/test/java/org/apache/karaf/config/command/MockCommandSession.java rename to config/command/src/test/java/org/apache/karaf/config/command/MockCommandSession.java diff --git a/config/src/test/java/org/apache/karaf/config/command/UpdateCommandTest.java b/config/command/src/test/java/org/apache/karaf/config/command/UpdateCommandTest.java similarity index 100% rename from config/src/test/java/org/apache/karaf/config/command/UpdateCommandTest.java rename to config/command/src/test/java/org/apache/karaf/config/command/UpdateCommandTest.java diff --git a/config/pom.xml b/config/core/pom.xml similarity index 96% copy from config/pom.xml copy to config/core/pom.xml index a268df7d99..0018d91cd2 100644 --- a/config/pom.xml +++ b/config/core/pom.xml @@ -22,8 +22,8 @@ <modelVersion>4.0.0</modelVersion> <parent> - <groupId>org.apache.karaf</groupId> - <artifactId>karaf</artifactId> + <groupId>org.apache.karaf.config</groupId> + <artifactId>config</artifactId> <version>4.4.5-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> @@ -140,12 +140,11 @@ <configuration> <instructions> <Export-Package> - org.apache.karaf.config.command*, org.apache.karaf.config.core, org.apache.felix.utils.properties;version="${felix.utils.version}" </Export-Package> <Import-Package> - org.osgi.service.metatype;resolution:=optional, + org.osgi.service.metatype, org.osgi.framework;version="[1,3)", * </Import-Package> diff --git a/config/src/main/java/org/apache/karaf/config/core/ConfigMBean.java b/config/core/src/main/java/org/apache/karaf/config/core/ConfigMBean.java similarity index 100% rename from config/src/main/java/org/apache/karaf/config/core/ConfigMBean.java rename to config/core/src/main/java/org/apache/karaf/config/core/ConfigMBean.java diff --git a/config/src/main/java/org/apache/karaf/config/core/ConfigRepository.java b/config/core/src/main/java/org/apache/karaf/config/core/ConfigRepository.java similarity index 100% rename from config/src/main/java/org/apache/karaf/config/core/ConfigRepository.java rename to config/core/src/main/java/org/apache/karaf/config/core/ConfigRepository.java diff --git a/config/src/main/java/org/apache/karaf/config/core/impl/MetaServiceCaller.java b/config/core/src/main/java/org/apache/karaf/config/core/MetaServiceCaller.java similarity index 99% rename from config/src/main/java/org/apache/karaf/config/core/impl/MetaServiceCaller.java rename to config/core/src/main/java/org/apache/karaf/config/core/MetaServiceCaller.java index 87efeeba17..e98d53eeec 100644 --- a/config/src/main/java/org/apache/karaf/config/core/impl/MetaServiceCaller.java +++ b/config/core/src/main/java/org/apache/karaf/config/core/MetaServiceCaller.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.karaf.config.core.impl; +package org.apache.karaf.config.core; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; diff --git a/config/src/main/java/org/apache/karaf/config/core/impl/ConfigMBeanImpl.java b/config/core/src/main/java/org/apache/karaf/config/core/impl/ConfigMBeanImpl.java similarity index 100% rename from config/src/main/java/org/apache/karaf/config/core/impl/ConfigMBeanImpl.java rename to config/core/src/main/java/org/apache/karaf/config/core/impl/ConfigMBeanImpl.java diff --git a/config/src/main/java/org/apache/karaf/config/core/impl/ConfigRepositoryImpl.java b/config/core/src/main/java/org/apache/karaf/config/core/impl/ConfigRepositoryImpl.java similarity index 100% rename from config/src/main/java/org/apache/karaf/config/core/impl/ConfigRepositoryImpl.java rename to config/core/src/main/java/org/apache/karaf/config/core/impl/ConfigRepositoryImpl.java diff --git a/config/src/main/java/org/apache/karaf/config/core/impl/JsonConfigInstaller.java b/config/core/src/main/java/org/apache/karaf/config/core/impl/JsonConfigInstaller.java similarity index 100% rename from config/src/main/java/org/apache/karaf/config/core/impl/JsonConfigInstaller.java rename to config/core/src/main/java/org/apache/karaf/config/core/impl/JsonConfigInstaller.java diff --git a/config/src/main/java/org/apache/karaf/config/core/impl/KarafConfigurationPlugin.java b/config/core/src/main/java/org/apache/karaf/config/core/impl/KarafConfigurationPlugin.java similarity index 100% rename from config/src/main/java/org/apache/karaf/config/core/impl/KarafConfigurationPlugin.java rename to config/core/src/main/java/org/apache/karaf/config/core/impl/KarafConfigurationPlugin.java diff --git a/config/src/main/java/org/apache/karaf/config/core/impl/osgi/Activator.java b/config/core/src/main/java/org/apache/karaf/config/core/impl/osgi/Activator.java similarity index 100% rename from config/src/main/java/org/apache/karaf/config/core/impl/osgi/Activator.java rename to config/core/src/main/java/org/apache/karaf/config/core/impl/osgi/Activator.java diff --git a/config/src/main/resources/OSGI-INF/metatype/metatype.properties b/config/core/src/main/resources/OSGI-INF/metatype/metatype.properties similarity index 90% rename from config/src/main/resources/OSGI-INF/metatype/metatype.properties rename to config/core/src/main/resources/OSGI-INF/metatype/metatype.properties index 3bce187b35..662d2a85a1 100644 --- a/config/src/main/resources/OSGI-INF/metatype/metatype.properties +++ b/config/core/src/main/resources/OSGI-INF/metatype/metatype.properties @@ -21,8 +21,8 @@ # This file contains localization strings for configuration labels and # descriptions as used in the metatype.xml descriptor -config.name = Apache Karaf Shell Config -config.description = Configuration of Apache Karaf Shell Config +config.name = Apache Karaf Config +config.description = Configuration of Apache Karaf Config storage.name = Storage directory storage.description = the directory used as a storage for configurations diff --git a/config/src/main/resources/OSGI-INF/metatype/metatype.xml b/config/core/src/main/resources/OSGI-INF/metatype/metatype.xml similarity index 100% rename from config/src/main/resources/OSGI-INF/metatype/metatype.xml rename to config/core/src/main/resources/OSGI-INF/metatype/metatype.xml diff --git a/config/src/test/java/org/apache/karaf/config/core/impl/ConfigMBeanImplTest.java b/config/core/src/test/java/org/apache/karaf/config/core/impl/ConfigMBeanImplTest.java similarity index 100% rename from config/src/test/java/org/apache/karaf/config/core/impl/ConfigMBeanImplTest.java rename to config/core/src/test/java/org/apache/karaf/config/core/impl/ConfigMBeanImplTest.java diff --git a/config/src/test/java/org/apache/karaf/config/core/impl/FelixFileInstallFilenameTest.java b/config/core/src/test/java/org/apache/karaf/config/core/impl/FelixFileInstallFilenameTest.java similarity index 100% rename from config/src/test/java/org/apache/karaf/config/core/impl/FelixFileInstallFilenameTest.java rename to config/core/src/test/java/org/apache/karaf/config/core/impl/FelixFileInstallFilenameTest.java diff --git a/config/src/test/java/org/apache/karaf/config/core/impl/JsonConfigInstallerTest.java b/config/core/src/test/java/org/apache/karaf/config/core/impl/JsonConfigInstallerTest.java similarity index 100% rename from config/src/test/java/org/apache/karaf/config/core/impl/JsonConfigInstallerTest.java rename to config/core/src/test/java/org/apache/karaf/config/core/impl/JsonConfigInstallerTest.java diff --git a/config/src/test/java/org/apache/karaf/config/core/impl/KarafConfigurationPluginTest.java b/config/core/src/test/java/org/apache/karaf/config/core/impl/KarafConfigurationPluginTest.java similarity index 100% rename from config/src/test/java/org/apache/karaf/config/core/impl/KarafConfigurationPluginTest.java rename to config/core/src/test/java/org/apache/karaf/config/core/impl/KarafConfigurationPluginTest.java diff --git a/config/src/test/resources/org.example.Arrays~no_update_required.cfg.json b/config/core/src/test/resources/org.example.Arrays~no_update_required.cfg.json similarity index 100% rename from config/src/test/resources/org.example.Arrays~no_update_required.cfg.json rename to config/core/src/test/resources/org.example.Arrays~no_update_required.cfg.json diff --git a/config/src/test/resources/org.example.Arrays~update_required.cfg.json b/config/core/src/test/resources/org.example.Arrays~update_required.cfg.json similarity index 100% rename from config/src/test/resources/org.example.Arrays~update_required.cfg.json rename to config/core/src/test/resources/org.example.Arrays~update_required.cfg.json diff --git a/config/src/test/resources/test.cfg b/config/core/src/test/resources/test.cfg similarity index 100% rename from config/src/test/resources/test.cfg rename to config/core/src/test/resources/test.cfg diff --git a/config/pom.xml b/config/pom.xml index a268df7d99..4ac05874f7 100644 --- a/config/pom.xml +++ b/config/pom.xml @@ -29,137 +29,13 @@ </parent> <groupId>org.apache.karaf.config</groupId> - <artifactId>org.apache.karaf.config.core</artifactId> - <packaging>bundle</packaging> - <name>Apache Karaf :: ConfigAdmin :: Core</name> - <description>This bundle provides Karaf services</description> + <artifactId>config</artifactId> + <packaging>pom</packaging> + <name>Apache Karaf :: ConfigAdmin</name> - <properties> - <appendedResourcesDirectory>${basedir}/../etc/appended-resources</appendedResourcesDirectory> - </properties> + <modules> + <module>core</module> + <module>command</module> + </modules> - <dependencyManagement> - <dependencies> - <dependency> - <groupId>org.apache.karaf</groupId> - <artifactId>karaf-bom</artifactId> - <version>${project.version}</version> - <type>pom</type> - <scope>import</scope> - </dependency> - </dependencies> - </dependencyManagement> - - <dependencies> - <dependency> - <groupId>org.osgi</groupId> - <artifactId>osgi.core</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.osgi</groupId> - <artifactId>org.osgi.service.cm</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.osgi</groupId> - <artifactId>org.osgi.service.metatype</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.osgi</groupId> - <artifactId>org.osgi.util.converter</artifactId> - <version>1.0.9</version> - <scope>provided</scope> - </dependency> - - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - </dependency> - - <dependency> - <groupId>org.apache.karaf</groupId> - <artifactId>org.apache.karaf.util</artifactId> - </dependency> - <dependency> - <groupId>org.apache.felix</groupId> - <artifactId>org.apache.felix.cm.json</artifactId> - </dependency> - <dependency> - <groupId>org.apache.sling</groupId> - <artifactId>org.apache.sling.commons.johnzon</artifactId> - </dependency> - <dependency> - <groupId>org.apache.geronimo.specs</groupId> - <artifactId>geronimo-json_1.1_spec</artifactId> - <version>1.5</version> - </dependency> - <dependency> - <groupId>org.apache.felix</groupId> - <artifactId>org.apache.felix.fileinstall</artifactId> - </dependency> - - <dependency> - <groupId>org.apache.karaf.shell</groupId> - <artifactId>org.apache.karaf.shell.core</artifactId> - <optional>true</optional> - </dependency> - - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-jdk14</artifactId> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <resources> - <resource> - <directory>${project.basedir}/src/main/resources</directory> - <includes> - <include>**/*</include> - </includes> - </resource> - <resource> - <directory>${project.basedir}/src/main/resources</directory> - <filtering>true</filtering> - <includes> - <include>**/*.info</include> - </includes> - </resource> - </resources> - <plugins> - <plugin> - <groupId>org.apache.karaf.tooling</groupId> - <artifactId>karaf-services-maven-plugin</artifactId> - </plugin> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <configuration> - <instructions> - <Export-Package> - org.apache.karaf.config.command*, - org.apache.karaf.config.core, - org.apache.felix.utils.properties;version="${felix.utils.version}" - </Export-Package> - <Import-Package> - org.osgi.service.metatype;resolution:=optional, - org.osgi.framework;version="[1,3)", - * - </Import-Package> - <Private-Package> - org.apache.karaf.config.core.impl, - org.apache.karaf.config.core.impl.osgi, - org.apache.karaf.util, - org.apache.karaf.util.config, - org.apache.felix.utils.collections - </Private-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> - -</project> +</project> \ No newline at end of file