Skip to content

Commit

Permalink
getServerConfigDocument update
Browse files Browse the repository at this point in the history
  • Loading branch information
dshimo committed Apr 17, 2024
1 parent b9d13aa commit f9f45e9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,11 @@ protected void verifyAppStarted(String appFile) throws MojoExecutionException {
if (shouldValidateAppStart()) {
String appName = appFile.substring(0, appFile.lastIndexOf('.'));
if (getAppsDirectory().equals("apps")) {

File serverXML = new File(serverDirectory, "server.xml");

try {
Map<String, File> libertyDirPropertyFiles = getLibertyDirectoryPropertyFiles();
CommonLogger logger = new CommonLogger(getLog());
setLog(logger.getLog());
getServerConfigDocument(logger, serverXML, libertyDirPropertyFiles);
getServerConfigDocument(logger, libertyDirPropertyFiles);

//appName will be set to a name derived from appFile if no name can be found.
appName = scd.findNameForLocation(appFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,10 @@ protected void undeployApp(File file) throws MojoExecutionException {
if (getAppsDirectory().equals("apps")) {

try {
File serverXML = new File(serverDirectory.getCanonicalPath(), "server.xml");

Map<String, File> libertyDirPropertyFiles = getLibertyDirectoryPropertyFiles();
CommonLogger logger = new CommonLogger(getLog());
setLog(logger.getLog());
getServerConfigDocument(logger, serverXML, configDirectory,
bootstrapPropertiesFile, combinedBootstrapProperties, serverEnvFile, false, libertyDirPropertyFiles);
getServerConfigDocument(logger, libertyDirPropertyFiles);

//appName will be set to a name derived from file if no name can be found.
appName = scd.findNameForLocation(appName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,7 @@ protected Set<String> getAppConfigLocationsFromSourceServerXml() {
Map<String, File> libertyDirPropertyFiles = getLibertyDirectoryPropertyFiles();
CommonLogger logger = new CommonLogger(getLog());
setLog(logger.getLog());
// scd = getServerConfigDocument(logger, serverXML, configDirectory,
// bootstrapPropertiesFile, combinedBootstrapProperties, serverEnvFile, false,
// libertyDirPropertyFiles);
scd = getServerConfigDocument(logger, serverXML, libertyDirPropertyFiles);
scd = getServerConfigDocument(logger, libertyDirPropertyFiles);
} catch (Exception e) {
getLog().warn(e.getLocalizedMessage());
getLog().debug(e);
Expand All @@ -386,6 +383,7 @@ protected Set<String> getAppConfigLocationsFromSourceServerXml() {
return scd != null ? scd.getLocations() : new HashSet<String>();
}

// Deprecated after ci.common 1.8.33
protected ServerConfigDocument getServerConfigDocument(CommonLoggerI log, File serverXML, File configDir, File bootstrapFile,
Map<String, String> bootstrapProp, File serverEnvFile, boolean giveConfigDirPrecedence, Map<String, File> libertyDirPropertyFiles) throws IOException {
if (scd == null || !scd.getServerXML().getCanonicalPath().equals(serverXML.getCanonicalPath())) {
Expand All @@ -395,12 +393,8 @@ protected ServerConfigDocument getServerConfigDocument(CommonLoggerI log, File s
return scd;
}

protected ServerConfigDocument getServerConfigDocument(CommonLoggerI log, File serverXML, Map<String, File> libertyDirPropertyFiles) throws IOException {
if (scd == null || !scd.getServerXML().getCanonicalPath().equals(serverXML.getCanonicalPath())) {
scd = new ServerConfigDocument(log, libertyDirPropertyFiles);
}

return scd;
protected ServerConfigDocument getServerConfigDocument(CommonLoggerI log, Map<String, File> libertyDirPropertyFiles) throws IOException {
return new ServerConfigDocument(log, libertyDirPropertyFiles);
}

protected String getAppsDirectory() {
Expand Down

0 comments on commit f9f45e9

Please sign in to comment.