Skip to content

Commit

Permalink
Fix for GAL-369, Introduce a System property to disable capability ch…
Browse files Browse the repository at this point in the history
…ecks
  • Loading branch information
jfdenise committed Nov 11, 2024
1 parent e80cb19 commit 15f23d8
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 Red Hat, Inc. and/or its affiliates
* Copyright 2016-2024 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -72,6 +72,7 @@ private static boolean getBooleanProp(Map<String, String> props, String name, bo
private List<ResolvedFeature> orderedFeatures = Collections.emptyList();
private List<ResolvedFeature> independentBatchBranch = Collections.emptyList();
private List<ResolvedFeature> independentNonBatchBranch = Collections.emptyList();
private final boolean ignoreCapabilities;

DefaultBranchedConfigArranger(ConfigModelStack configStack) {
this.configStack = configStack;
Expand All @@ -83,6 +84,8 @@ private static boolean getBooleanProp(Map<String, String> props, String name, bo
branchIsBatch = getBooleanProp(configStack.props, ConfigModel.BRANCH_IS_BATCH, false);
isolateCircularDeps = getBooleanProp(configStack.props, ConfigModel.ISOLATE_CIRCULAR_DEPS, false);
mergeIndependentBranches = getBooleanProp(configStack.props, ConfigModel.MERGE_INDEPENDENT_BRANCHES, false);
// When analyzing incomplete configuration, capabilities can be missing and capability check be disabled.
ignoreCapabilities = Boolean.getBoolean("org.jboss.galleon.internal.ignore.capability.providers");
}

List<ResolvedFeature> orderFeatures() throws ProvisioningException {
Expand Down Expand Up @@ -626,7 +629,7 @@ private List<CircularRefInfo> orderCapabilityProviders(ResolvedFeature feature,
throws ProvisioningException {
for (CapabilitySpec capSpec : feature.spec.xmlSpec.getRequiredCapabilities()) {
final List<String> resolvedCaps = capResolver.resolve(capSpec, feature);
if (resolvedCaps.isEmpty()) {
if (resolvedCaps.isEmpty() || ignoreCapabilities) {
continue;
}
for (String resolvedCap : resolvedCaps) {
Expand Down

0 comments on commit 15f23d8

Please sign in to comment.