You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2019/03/26 06:56:32 UTC

[karaf] branch karaf-4.2.x updated: KARAF-6207, bootFeatures sometimes being ignored

This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch karaf-4.2.x
in repository https://gitbox.apache.org/repos/asf/karaf.git


The following commit(s) were added to refs/heads/karaf-4.2.x by this push:
     new f40bf24  KARAF-6207, bootFeatures sometimes being ignored
     new e6ba080  Merge pull request #791 from lkiesow/karaf-6207-bootFeatures
f40bf24 is described below

commit f40bf2475ebb8142494c2e86770a12408ec5b9d6
Author: Lars Kiesow <lk...@uos.de>
AuthorDate: Sun Mar 24 00:48:10 2019 +0100

    KARAF-6207, bootFeatures sometimes being ignored
    
    According to the documentation, the maven-karaf-plugin will install
    features listed in the installedFeatures in the "system" internal
    repository. Features listed in bootFeatures are additionally added to
    the boot-features in the features service configuration file.
    
    Hence, the configuration options do not conflict and a configuration
    like this should result in the features being installed and added to the
    boot-features configuration:
    
        <configuration>
          <bootFeatures>
            <feature>foo</feature>
          </bootFeatures>
          <installedFeatures>
            <feature>foo</feature>
          </installedFeatures>
        </configuration>
    
    In fact, the configuration should be equivalent to `foo` being listed
    just as a bootFeature.
    
    But what actually happens is that the installedFeature will overwrite
    the bootFeature and the feature is not added to the boot-features
    configuration.
    
    This patch switches the handling of bootFeatures and installedFeatures
    which makes a feature configured in both sections a bootFeature,
    adhering to the specifications of both configurations.
---
 .../main/java/org/apache/karaf/tooling/AssemblyMojo.java | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/AssemblyMojo.java b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/AssemblyMojo.java
index 427daf9..dd87e25 100644
--- a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/AssemblyMojo.java
+++ b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/AssemblyMojo.java
@@ -536,14 +536,6 @@ public class AssemblyMojo extends MojoSupport {
                .bundles(toArray(startupBundles))
                .profiles(toArray(startupProfiles));
 
-        // Boot stage
-        builder.defaultStage(Builder.Stage.Boot)
-                .kars(toArray(bootKars))
-                .repositories(bootFeatures.isEmpty() && bootProfiles.isEmpty() && installAllFeaturesByDefault, toArray(bootRepositories))
-                .features(toArray(bootFeatures))
-                .bundles(toArray(bootBundles))
-                .profiles(toArray(bootProfiles));
-
         // Installed stage
         builder.defaultStage(Builder.Stage.Installed)
                 .kars(toArray(installedKars))
@@ -552,6 +544,14 @@ public class AssemblyMojo extends MojoSupport {
                 .bundles(toArray(installedBundles))
                 .profiles(toArray(installedProfiles));
 
+        // Boot stage
+        builder.defaultStage(Builder.Stage.Boot)
+                .kars(toArray(bootKars))
+                .repositories(bootFeatures.isEmpty() && bootProfiles.isEmpty() && installAllFeaturesByDefault, toArray(bootRepositories))
+                .features(toArray(bootFeatures))
+                .bundles(toArray(bootBundles))
+                .profiles(toArray(bootProfiles));
+
         // Generate the assembly
         builder.generateAssembly();