Skip to content

Commit e4fa625

Browse files
committed
Revert "[KARAF-4255] Only include conditional dependencies in assembly if condition is met"
This reverts commit 8ba5776.
1 parent 62f538f commit e4fa625

File tree

1 file changed

+9
-26
lines changed
  • profile/src/main/java/org/apache/karaf/profile/assembly

1 file changed

+9
-26
lines changed

profile/src/main/java/org/apache/karaf/profile/assembly/Builder.java

+9-26
Original file line numberDiff line numberDiff line change
@@ -763,12 +763,10 @@ private void installStage(Profile installedProfile, Set<Feature> allBootFeatures
763763
}
764764
}
765765
for (Conditional cond : feature.getConditional()) {
766-
if (isConditionalMet(cond, installedFeatures)) {
767-
for (Bundle bundle : cond.getBundle()) {
768-
if (!ignoreDependencyFlag || !bundle.isDependency()) {
769-
installArtifact(downloader, bundle.getLocation().trim());
770-
}
771-
}
766+
for (Bundle bundle : cond.getBundle()) {
767+
if (!ignoreDependencyFlag || !bundle.isDependency()) {
768+
installArtifact(downloader, bundle.getLocation().trim());
769+
}
772770
}
773771
}
774772
}
@@ -834,11 +832,9 @@ private Set<Feature> bootStage(Profile bootProfile, Profile startupEffective) th
834832
}
835833
}
836834
for (Conditional cond : feature.getConditional()) {
837-
if (isConditionalMet(cond, bootFeatures)) {
838-
for (Bundle bundle : cond.getBundle()) {
839-
if (!ignoreDependencyFlag || !bundle.isDependency()) {
840-
locations.add(bundle.getLocation().trim());
841-
}
835+
for (Bundle bundle : cond.getBundle()) {
836+
if (!ignoreDependencyFlag || !bundle.isDependency()) {
837+
locations.add(bundle.getLocation().trim());
842838
}
843839
}
844840
}
@@ -871,10 +867,8 @@ private Set<Feature> bootStage(Profile bootProfile, Profile startupEffective) th
871867
installArtifact(downloader, configFile.getLocation().trim());
872868
}
873869
for (Conditional cond : feature.getConditional()) {
874-
if (isConditionalMet(cond, bootFeatures)) {
875-
for (ConfigFile configFile : cond.getConfigfile()) {
876-
installArtifact(downloader, configFile.getLocation().trim());
877-
}
870+
for (ConfigFile configFile : cond.getConfigfile()) {
871+
installArtifact(downloader, configFile.getLocation().trim());
878872
}
879873
}
880874
// Install libraries
@@ -945,17 +939,6 @@ private Set<Feature> bootStage(Profile bootProfile, Profile startupEffective) th
945939
return allBootFeatures;
946940
}
947941

948-
private boolean isConditionalMet(Conditional cond, Set<Feature> bootFeatures) {
949-
for (String condition : cond.getCondition()) {
950-
for (Feature feature : bootFeatures) {
951-
if (feature.getName().equals(condition)) {
952-
return true;
953-
}
954-
}
955-
}
956-
return false;
957-
}
958-
959942
private String getRepos(Features rep) {
960943
StringBuilder repos = new StringBuilder();
961944
for (String repo : new HashSet<>(rep.getRepository())) {

0 commit comments

Comments
 (0)