Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable local esa install feature for OL #428

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,12 @@ public void installFeatures(boolean isAcceptLicense, List<String> featuresList)
info("Recommended user action: upgrade to OpenLiberty version " + MIN_USER_FEATURE_VERSION + " or higher and provide features-bom file for the user feature esa.");

copyUserFeature(pluginListedEsas, installDirectory);
}
} else {
featuresToInstall.addAll(pluginListedEsas);
}
}



for (String feature: featuresList) {
if (feature.contains(":")) {
Expand Down Expand Up @@ -723,7 +727,7 @@ public void installFeatures(boolean isAcceptLicense, List<String> featuresList)
mapBasedInstallKernel = createMapBasedInstallKernelInstance(bundle, installDirectory);


Collection<?> resolvedFeatures = resolveFeatures(featuresToInstall, jsonRepos, acceptLicenseMapValue);
Collection<?> resolvedFeatures = resolveFeatures(featuresToInstall, jsonRepos, acceptLicenseMapValue, pluginListedEsas);
if(resolvedFeatures == null || resolvedFeatures.isEmpty()) {
return;
}
Expand Down Expand Up @@ -813,16 +817,19 @@ public void installFeatures(boolean isAcceptLicense, List<String> featuresList)
* @throws PluginExecutionException
*/
private Collection<?> resolveFeatures(List<String> featuresToInstall, List<File> jsonRepos,
boolean acceptLicenseMapValue) throws PluginExecutionException {
boolean acceptLicenseMapValue, Set<String> localESA) throws PluginExecutionException {
info("Resolving features... " );

mapBasedInstallKernel.put("install.local.esa", true);
mapBasedInstallKernel.put("single.json.file", jsonRepos);
mapBasedInstallKernel.put("features.to.resolve", featuresToInstall);
mapBasedInstallKernel.put("license.accept", acceptLicenseMapValue);
mapBasedInstallKernel.put("is.install.server.feature", true);


if(!localESA.isEmpty()) {
mapBasedInstallKernel.put("install.individual.esas", true);
mapBasedInstallKernel.put("individual.esas", localESA.stream().map(File::new).collect(Collectors.toList()));
}

Collection<?> resolvedFeatures = (Collection<?>) mapBasedInstallKernel.get("action.result");
if (resolvedFeatures == null) {
debug("action.exception.stacktrace: " + mapBasedInstallKernel.get("action.exception.stacktrace"));
Expand Down