Hi,
I'm almost sure the annotations are not needed during execution. During
runtime, SCR uses the XML files included inside the bundle (jar).
The bundle plugin uses the annotation in the classes to generate those xml
descriptors.
In my maven projects, I normally use the "bom" dependency provided by karaf
to ensure I'm using the same dependencies used by Karaf. For example:

> <dependency>
>     <groupId>org.apache.karaf</groupId>
>     <artifactId>karaf-bom</artifactId>
>     <version>${karaf.version}</version>
>     <type>pom</type>
>     <scope>import</scope>
> </dependency>


But for my convenience, I tend to use the Enroute dependency:
<dependency>
    <groupId>org.osgi.enroute</groupId>
    <artifactId>osgi-api</artifactId>
    <version>7.0.0</version>
    <type>pom</type>
    <scope>provided</scope>

> </dependency>


Best regards,
João





On Thu, Apr 17, 2025 at 11:50 AM Ephemeris Lappis <
[email protected]> wrote:

> Hello.
>
> I can't find if a Karaf feature exists to provide the annotations for SCR,
> such as Service, Reference, etc.
>
> Installing the feature "scr" just adds bundles to manage the runtime, not
> the annotations.
>
> Perhaps the packages are provided by  a Compendium bundle.
>
> Is there a provided feature that includes them, or do we have to add
> explicitly bundles for that ? In this case, what is the right version to
> match the OSGi framework of Karaf 4.4.x ?
>
> Thanks for your help.
>
> Regards.
>

Reply via email to