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

1366 server.xml feature removal #345

Merged
merged 2 commits into from
Feb 23, 2022
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 @@ -2450,14 +2450,16 @@ protected void setFeatureGeneration(boolean generateFeatures) {
/**
* Generate features using all classes and only user specified features.
*/
private void optimizeGenerateFeatures() {
private boolean optimizeGenerateFeatures() {
info("Generating optimized features list...");
// scan all class files and provide only user specified features
boolean generatedFeatures = libertyGenerateFeatures(null, true);
if (generatedFeatures) {
javaSourceClasses.clear();
} // do not need to log an error if generatedFeatures is false because that would
// have already been logged by libertyGenerateFeatures

return generatedFeatures;
}

/**
Expand Down Expand Up @@ -4016,7 +4018,7 @@ private void processFileChanges(
generateFeaturesSuccess = false;
// custom server.xml modified
// TODO: revisit scenarios in which we should skip install features
generateFeaturesSuccess = incrementGenerateFeatures();
generateFeaturesSuccess = optimizeGenerateFeatures();
}
// suppress install feature warning - property must be set before calling copyConfigFolder
System.setProperty(SKIP_BETA_INSTALL_WARNING, Boolean.TRUE.toString());
Expand All @@ -4039,7 +4041,7 @@ private void processFileChanges(
// custom server.xml is deleted
// TODO: test this scenario and decide if generating features is necessary
// if we generate, it may need to be optimized
incrementGenerateFeatures();
optimizeGenerateFeatures();
}
// Let this restart if needed for container mode. Otherwise, nothing else needs to be done for config file delete.
if (isDockerfileDirectoryChanged(serverDirectory, fileChanged)) {
Expand All @@ -4060,7 +4062,7 @@ private void processFileChanges(
generateFeaturesSuccess = false;
// server.xml modified
// TODO: revisit scenarios in which we should skip install features
generateFeaturesSuccess = incrementGenerateFeatures();
generateFeaturesSuccess = optimizeGenerateFeatures();
}
// suppress install feature warning - property must be set before calling copyConfigFolder
System.setProperty(SKIP_BETA_INSTALL_WARNING, Boolean.TRUE.toString());
Expand Down Expand Up @@ -4103,7 +4105,7 @@ private void processFileChanges(
// server.xml is deleted
// TODO: test this scenario and decide if generating features is necessary
// if we generate, it may need to be optimized
incrementGenerateFeatures();
optimizeGenerateFeatures();
}
if (isDockerfileDirectoryChanged(serverDirectory, fileChanged)) {
untrackDockerfileDirectoriesAndRestart();
Expand Down