Skip to content

Commit

Permalink
varprocessing incorparate review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Arun Venmany <[email protected]>
  • Loading branch information
arunvenmany-ibm committed Nov 11, 2024
1 parent 85b8432 commit ae23c0c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -505,11 +505,10 @@ abstract class AbstractServerTask extends AbstractLibertyTask {
configureMultipleAppsConfigDropins(serverNode)
}

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

return scd
}

Expand All @@ -518,8 +517,7 @@ abstract class AbstractServerTask extends AbstractLibertyTask {
File serverConfigFile = new File(getServerDir(project), 'server.xml')
if (serverConfigFile != null && serverConfigFile.exists()) {
try {
Map<String,String> props = combinedBootstrapProperties == null ? convertPropertiesToMap(server.bootstrapProperties) : combinedBootstrapProperties;
scd = getServerConfigDocument(new CommonLogger(project), getLibertyDirectoryPropertyFiles(null));
scd = getServerConfigDocument(new CommonLogger(project), serverConfigFile, getLibertyDirectoryPropertyFiles(null));
if (scd != null && isLocationFound( scd.getLocations(), fileName)) {
logger.debug("Application configuration is found in server.xml : " + fileName)
configured = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ class DeployTask extends AbstractServerTask {
File serverXML = new File(getServerDir(project).getCanonicalPath(), "server.xml")

try {
scd = getServerConfigDocument(new CommonLogger(project), getLibertyDirectoryPropertyFiles(null))
scd = getServerConfigDocument(new CommonLogger(project), serverXML, getLibertyDirectoryPropertyFiles(null))

//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 @@ -85,8 +85,7 @@ class StartTask extends AbstractServerTask {
File serverConfigFile = new File(getServerDir(project), 'server.xml')
if (serverConfigFile != null && serverConfigFile.exists()) {
try {
Map<String,String> props = combinedBootstrapProperties == null ? convertPropertiesToMap(server.bootstrapProperties) : combinedBootstrapProperties;
scd = getServerConfigDocument(new CommonLogger(project), getLibertyDirectoryPropertyFiles(null));
scd = getServerConfigDocument(new CommonLogger(project), serverConfigFile, getLibertyDirectoryPropertyFiles(null));
if (scd != null) {
appNames = scd.getNames()
appNames += scd.getNamelessLocations().collect { String location ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class UndeployTask extends AbstractServerTask {
File serverXML = new File(getServerDir(project).getCanonicalPath(), "server.xml")

try {
scd= getServerConfigDocument(new CommonLogger(project), getLibertyDirectoryPropertyFiles(null))
scd= getServerConfigDocument(new CommonLogger(project), serverXML, getLibertyDirectoryPropertyFiles(null))

//appName will be set to a name derived from appFile if no name can be found.
appName = scd.findNameForLocation(file)
Expand Down

0 comments on commit ae23c0c

Please sign in to comment.