Skip to content

Commit 4689297

Browse files
authored
Merge pull request #356 from jfdenise/GAL-369
Fix for GAL-369, Introduce a System property to disable capability checks
2 parents e80cb19 + 15f23d8 commit 4689297

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

core/src/main/java/org/jboss/galleon/runtime/DefaultBranchedConfigArranger.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2019 Red Hat, Inc. and/or its affiliates
2+
* Copyright 2016-2024 Red Hat, Inc. and/or its affiliates
33
* and other contributors as indicated by the @author tags.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -72,6 +72,7 @@ private static boolean getBooleanProp(Map<String, String> props, String name, bo
7272
private List<ResolvedFeature> orderedFeatures = Collections.emptyList();
7373
private List<ResolvedFeature> independentBatchBranch = Collections.emptyList();
7474
private List<ResolvedFeature> independentNonBatchBranch = Collections.emptyList();
75+
private final boolean ignoreCapabilities;
7576

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

8891
List<ResolvedFeature> orderFeatures() throws ProvisioningException {
@@ -626,7 +629,7 @@ private List<CircularRefInfo> orderCapabilityProviders(ResolvedFeature feature,
626629
throws ProvisioningException {
627630
for (CapabilitySpec capSpec : feature.spec.xmlSpec.getRequiredCapabilities()) {
628631
final List<String> resolvedCaps = capResolver.resolve(capSpec, feature);
629-
if (resolvedCaps.isEmpty()) {
632+
if (resolvedCaps.isEmpty() || ignoreCapabilities) {
630633
continue;
631634
}
632635
for (String resolvedCap : resolvedCaps) {

0 commit comments

Comments
 (0)