You are mixing BaseActivator and Command.

BaseActivator is useless in term of command.

Just use the karaf-service-maven-plugin as describe in the example:

https://github.com/apache/karaf/blob/master/examples/karaf-command-example/karaf-command-example-command/pom.xml
 
<https://github.com/apache/karaf/blob/master/examples/karaf-command-example/karaf-command-example-command/pom.xml>

Regards
JB

> Le 13 juil. 2020 à 15:34, Paul Spencerx <[email protected]> a écrit :
> 
> JB,
> Removing the org.apache.karaf.util dependency result in the following 
> compilation error:
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile 
> (default-compile) on project ewm-scheduler: Compilation failure: Compilation 
> failure: 
> [ERROR] /.../internal/Activator.java:[4,47] error: package 
> org.apache.karaf.util.tracker.annotation does not exist
> [ERROR] /.../internal/Activator.java:[5,47] error: package 
> org.apache.karaf.util.tracker.annotation does not exist
> [ERROR] /.../internal/Activator.java:[12,1] error: cannot find symbol
> 
> ***
> * From Activator.java
> ***
> import org.apache.karaf.util.tracker.BaseActivator;
> import org.apache.karaf.util.tracker.annotation.ProvideService;
> import org.apache.karaf.util.tracker.annotation.Services;
> import org.quartz.SchedulerException;
> import org.slf4j.Logger;
> import org.slf4j.LoggerFactory;
> 
> import com.foo.FooService;
> 
> @Services(provides = { @ProvideService(FooService.class) })
> public class Activator extends BaseActivator {
> 
> 
> Paul Spencer
> 
> 
>> On Jul 13, 2020, at 1:03 AM, Jean-Baptiste Onofre <[email protected]> wrote:
>> 
>> By the way, you don’t need util in your bundle, it’s already included in 
>> shell.
>> 
>> Why would you need util (are you sure it’s not Felix util you want) ?
>> 
>> Regards
>> JB
>> 
>>> Le 11 juil. 2020 à 23:21, Paul Spencer <[email protected]> a écrit 
>>> :
>>> 
>>> Karaf 4.2.9
>>> I am receiving the following warning for bundles that exposes a services 
>>> and commands.
>>> 
>>>> [WARNING] Bundle ...: Split package, multiple jars provide the same 
>>>> package:org/apache/karaf/util/tracker
>>>> Use Import/Export Package directive 
>>>> -split-package:=(merge-first|merge-last|error|first) to get rid of this 
>>>> warning
>>>> Package found in   [Jar:org.apache.karaf.util, 
>>>> Jar:org.apache.karaf.shell.core]
>>> 
>>> I am including both dependencies with the default scope as they are need to 
>>> compile.
>>>       <dependency>
>>>          <groupId>org.apache.karaf</groupId>
>>>          <artifactId>org.apache.karaf.util</artifactId>
>>>      </dependency>
>>>      <dependency>
>>>          <groupId>org.apache.karaf.shell</groupId>
>>>          <artifactId>org.apache.karaf.shell.core</artifactId>
>>>      </dependency>
>>> 
>>> How should resolve the warning?
>>> 
>>> Paul Spencer
>> 
> 

Reply via email to