/** * Return a string representation of the feature. * * @return the feature string representation. */ public String toString() { return getId(); }
/** * Get all matching features * @param idOrPattern * @param features * @return */ public static Collection<String> getMatchingFeatures(FeaturePattern idOrPattern, Collection<Feature> features) { List<String> result = new LinkedList<>(); for (Feature feature : features) { // blacklisting will be applied anyway, so no need to do it here if (/*!feature.isBlacklisted() && */idOrPattern.matches(feature.getName(), feature.getVersion())) { result.add(feature.getId()); } } return result; }
/** * Get all matching features * @param idOrPattern * @param features * @return */ public static Collection<String> getMatchingFeatures(FeaturePattern idOrPattern, Collection<Feature> features) { List<String> result = new LinkedList<>(); for (Feature feature : features) { // blacklisting will be applied anyway, so no need to do it here if (/*!feature.isBlacklisted() && */idOrPattern.matches(feature.getName(), feature.getVersion())) { result.add(feature.getId()); } } return result; }
features.getFeature().forEach(feature -> { if (full || !feature.isBlacklisted()) { featureId2repository.put(feature.getId(), name); feature.getBundle().forEach(bundle -> { bundle2featureId.computeIfAbsent(bundle.getLocation().trim(), k -> new TreeSet<>()).add(feature.getId()); }); feature.getConditional().forEach(cond -> { cond.asFeature().getBundles().forEach(bundle -> { bundle2featureId.computeIfAbsent(bundle.getLocation().trim(), k -> new TreeSet<>()).add(feature.getId()); }); });
protected void retrieveDescriptorsRecursively(String uri, Set<String> bundles, Map<String, Feature> featuresMap) { // let's ensure a mvn: based url is sitting in the local repo before we try reading it Artifact descriptor; try { descriptor = resourceToArtifact(uri, true); } catch (MojoExecutionException e) { throw new RuntimeException(e.getMessage(), e); } if (descriptor != null) { resolveArtifact(descriptor, remoteRepos); descriptorArtifacts.add(descriptor); } if (includeMvnBasedDescriptors) { bundles.add(uri); } String uriToUse = descriptor != null ? descriptor.getFile().toURI().toString() : translateFromMaven(uri); Features repo = JaxbUtil.unmarshal(uriToUse, true); for (Feature f : repo.getFeature()) { featuresMap.put(f.getId(), f); } if (resolveDefinedRepositoriesRecursively) { for (String r : repo.getRepository()) { retrieveDescriptorsRecursively(r, bundles, featuresMap); } } }
/** * Assuming <code>idOrPattern</code> may be a pattern (with glob and version range), get all matching features * @param idOrPattern * @param repositories * @return */ public static Collection<String> getMatchingFeatures(String idOrPattern, Collection<Features> repositories) { List<String> result = new LinkedList<>(); FeaturePattern pattern = new FeaturePattern(idOrPattern); for (Features features : repositories) { for (Feature feature : features.getFeature()) { // blacklisting will be applied anyway, so no need to do it here if (/*!feature.isBlacklisted() && */pattern.matches(feature.getName(), feature.getVersion())) { result.add(feature.getId()); } } } return result; }
/** * Assuming <code>idOrPattern</code> may be a pattern (with glob and version range), get all matching features * @param idOrPattern * @param repositories * @return */ public static Collection<String> getMatchingFeatures(String idOrPattern, Collection<Features> repositories) { List<String> result = new LinkedList<>(); FeaturePattern pattern = new FeaturePattern(idOrPattern); for (Features features : repositories) { for (Feature feature : features.getFeature()) { // blacklisting will be applied anyway, so no need to do it here if (/*!feature.isBlacklisted() && */pattern.matches(feature.getName(), feature.getVersion())) { result.add(feature.getId()); } } } return result; }
protected void retrieveDescriptorsRecursively(String uri, Set<String> bundles, Map<String, Feature> featuresMap) { // let's ensure a mvn: based url is sitting in the local repo before we try reading it Artifact descriptor; try { descriptor = resourceToArtifact(uri, true); } catch (MojoExecutionException e) { throw new RuntimeException(e.getMessage(), e); } if (descriptor != null) { resolveArtifact(descriptor, remoteRepos); descriptorArtifacts.add(descriptor); } if (includeMvnBasedDescriptors) { bundles.add(uri); } String uriToUse = descriptor != null ? descriptor.getFile().toURI().toString() : translateFromMaven(uri); Features repo = JaxbUtil.unmarshal(uriToUse, true); for (Feature f : repo.getFeature()) { featuresMap.put(f.getId(), f); } if (resolveDefinedRepositoriesRecursively) { for (String r : repo.getRepository()) { retrieveDescriptorsRecursively(r, bundles, featuresMap); } } }
features.getFeature().forEach(feature -> { if (flavor.include(feature)) { featureId2repository.put(feature.getId(), name); feature.getBundle().forEach(bundle -> { bundle2featureId.computeIfAbsent(bundle.getLocation().trim(), k -> new TreeSet<>()).add(feature.getId()); bundle2featureId.computeIfAbsent(bundle.getLocation().trim(), k -> new TreeSet<>()).add(feature.getId());
for (Feature feature : installedFeatures) { if (feature.isBlacklisted()) { LOGGER.info(" Feature " + feature.getId() + " is blacklisted, ignoring"); continue; LOGGER.info(" Feature {} is defined as an installed feature", feature.getId()); for (Bundle bundle : feature.getBundle()) { if (!ignoreDependencyFlag || !bundle.isDependency()) {
for (Feature feature : installedFeatures) { if (feature.isBlacklisted()) { LOGGER.info(" Feature " + feature.getId() + " is blacklisted, ignoring"); continue; LOGGER.info(" Feature {} is defined as an installed feature", feature.getId()); for (Bundle bundle : feature.getBundle()) { if (!ignoreDependencyFlag || !bundle.isDependency()) {