Hi,

We are currently using Karaf 4.4.7 and would like to install - not start - a 
feature using the karaf-maven-plugin. The goal is to build a distribution which 
provides some installed features - ready to participate in capability / 
requirement resolution, being activated automatically by potential consumers - 
which are not started. Features should only be started when required by other 
additional features being added to the distribution.
Using the CLI, this can be easily achieved with features:install -s.

Using the Maven plugin, we currently tried (among others, but that seems the 
best approach):

...
<dependency>
  <groupId>myGroupId</groupId>
  <artifactId>myFeaturesCollection</artifactId>
  <version>7.4.0-20250718115859_72_11ed374</version>
  <classifier>features</classifier>
  <type>xml</type>
  <scope>provided</scope>
</dependency>
...
<plugin>
  <groupId>org.apache.karaf.tooling</groupId>
  <artifactId>karaf-maven-plugin</artifactId>
  <version>4.4.7</version>
  <extensions>true</extensions>
  <configuration>
    <finalName>${project.artifactId}</finalName>
    <startupFeatures>
      <startupFeature>eventadmin</startupFeature>
    </startupFeatures>
    <bootFeatures>
      <bootFeature>standard</bootFeature>
    </bootFeatures>
    <installedRepositories>
      
<installedRepository>mvn:myGroupId/myFeaturesCollection/7.4.0-20250718115859_72_11ed374/xml/features</installedRepository>
    </installedRepositories>
    <installedFeatures>
      <installedFeature>scr</installedFeature>
      <installedFeature>myFeature</installedFeature>
    </installedFeatures>
    <archiveZip>false</archiveZip>
  </configuration>
</plugin>
...

The result is (hope this will end up being more or less readable):
karaf@user()> feature:list
Name                                           ?? Version                       
  ?? Required ?? State       ?? Repository                      ?? Description
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
myFeature               ?? 2.0.2.20250718115859_72_11ed374 ??          ?? 
Uninstalled ?? myFeaturesCollection                  ?? KISTERS :: myFeature
scr                                            ?? 4.4.7                         
  ??          ?? Uninstalled ?? standard-4.4.7                  ?? Declarative 
Service support

So it seems to have no effect - unlike using the CLI.

The build log however shows:
14:31:31,546 [INFO] Install stage
14:31:31,548 [INFO]    Loading installed repositories
14:31:31,549 [INFO]       adding feature repository: 
mvn:myGroupId/myFeaturesCollection/7.4.0-20250718115859_72_11ed374/xml/features
14:31:31,567 [INFO]    Feature scr/4.4.7 is defined as an installed feature
14:31:31,567 [INFO]       adding maven artifact: 
mvn:org.osgi/org.osgi.util.function/1.2.0
14:31:31,568 [INFO]       adding maven artifact: 
mvn:org.osgi/org.osgi.util.promise/1.3.0
14:31:31,569 [INFO]       adding maven artifact: 
mvn:org.osgi/org.osgi.service.component/1.5.1
14:31:31,569 [INFO]       adding maven artifact: 
mvn:org.apache.felix/org.apache.felix.scr/2.2.6
14:31:31,569 [INFO]       adding maven artifact: 
mvn:org.apache.karaf.scr/org.apache.karaf.scr.management/4.4.7
14:31:31,569 [INFO]       adding maven artifact: 
mvn:org.apache.felix/org.apache.felix.inventory/1.1.0
14:31:31,569 [INFO]       adding maven artifact: 
mvn:org.apache.felix/org.apache.felix.webconsole.plugins.ds/2.2.0
14:31:31,569 [INFO]       adding maven artifact: 
mvn:org.apache.karaf.scr/org.apache.karaf.scr.state/4.4.7
14:31:31,569 [INFO]    Feature myFeature/2.0.2.20250718115859_72_11ed374 is 
defined as an installed feature
14:31:31,569 [INFO]       adding maven artifact: 
mvn:myGroupId/implementationBundle/2.0.1-20240621202928_41_e02eb41

Is this a bug or do we do something wrong?

Thanks!

Regards,
C??dric
________________________________
C??dric Jonas - HydroMet - KISTERS AG - Pascalstra?e 8+10 - 52076 Aachen - DE | 
+49 2408 9385 -453 | [email protected] | www.kisters.de | Handelsregister 
Aachen, HRB-Nr. 7838 | Vorstand: Klaus Kisters, Hanns Kisters | 
Aufsichtsratsvorsitzender: Dr. Thomas Klevers
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and destroy this e-mail. Any unauthorised 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden.
Diese E-Mail enth?lt vertrauliche und/oder rechtlich gesch??tzte Informationen. 
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt??mlich 
erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie 
diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail 
ist nicht gestattet.

Reply via email to