/** Add Karaf core features URL in the default repositories set */
  private void appendKarafCoreFeaturesDescriptors() {
    if (repositories == null) {
      repositories = new ArrayList<String>();
    }
    if (karafVersion == null) {
      Package p = Package.getPackage("org.apache.karaf.tooling.features");
      karafVersion = p.getImplementationVersion();
    }
    String karafCoreStandardFeaturesUrl =
        String.format(KARAF_CORE_STANDARD_FEATURE_URL, karafVersion);
    String karafCoreEnterpriseFeaturesUrl =
        String.format(KARAF_CORE_ENTERPRISE_FEATURE_URL, karafVersion);

    try {
      resolve(karafCoreStandardFeaturesUrl);
      repositories.add(karafCoreStandardFeaturesUrl);
    } catch (Exception e) {
      warn("Can't add " + karafCoreStandardFeaturesUrl + " in the default repositories set");
    }

    try {
      resolve(karafCoreEnterpriseFeaturesUrl);
      repositories.add(karafCoreEnterpriseFeaturesUrl);
    } catch (Exception e) {
      warn("Can't add " + karafCoreStandardFeaturesUrl + " in the default repositories set");
    }
  }
 private void ensureDroolsRuntimeMatches(
     String expectedRuntimeVersion, VersionCheckStrategy versionCheckStrategy) {
   final Package droolsCorePackage = KnowledgePackageImp.class.getPackage();
   final String implementationTitle = droolsCorePackage.getImplementationTitle();
   final String implementationVersion = droolsCorePackage.getImplementationVersion();
   switch (versionCheckStrategy) {
     case VERSIONS_MUST_MATCH:
       ensureVersionsMatch(expectedRuntimeVersion, implementationTitle, implementationVersion);
       break;
     case IGNORE_UNKNOWN_RUNTIME_VERSION:
       ensureVersionsMatchIgnoringUnknown(
           expectedRuntimeVersion, implementationTitle, implementationVersion);
       break;
   }
 }