diff --git a/build.gradle b/build.gradle index cc5e19e3..c1dd63c8 100644 --- a/build.gradle +++ b/build.gradle @@ -57,7 +57,7 @@ compileTestGroovy { } def libertyAntVersion = "1.9.16" -def libertyCommonVersion = "1.8.35" +def libertyCommonVersion = "1.8.36-SNAPSHOT" dependencies { implementation gradleApi() diff --git a/src/main/groovy/io/openliberty/tools/gradle/tasks/AbstractServerTask.groovy b/src/main/groovy/io/openliberty/tools/gradle/tasks/AbstractServerTask.groovy index aa22c6d2..41a1926b 100644 --- a/src/main/groovy/io/openliberty/tools/gradle/tasks/AbstractServerTask.groovy +++ b/src/main/groovy/io/openliberty/tools/gradle/tasks/AbstractServerTask.groovy @@ -505,10 +505,9 @@ abstract class AbstractServerTask extends AbstractLibertyTask { configureMultipleAppsConfigDropins(serverNode) } - protected ServerConfigDocument getServerConfigDocument(CommonLogger log, File serverXML, File configDir, File bootstrapFile, - Map bootstrapProp, File serverEnvFile, boolean giveConfigDirPrecedence, Map libertyDirPropertyFiles) throws IOException { - if (scd == null || !scd.getServerXML().getCanonicalPath().equals(serverXML.getCanonicalPath())) { - scd = new ServerConfigDocument(log, serverXML, configDir, bootstrapFile, bootstrapProp, serverEnvFile, giveConfigDirPrecedence, libertyDirPropertyFiles) + protected ServerConfigDocument getServerConfigDocument(CommonLogger log, File serverXML, Map libertyDirPropertyFiles) throws IOException { + if (scd == null || !scd.getOriginalServerXMLFile().getCanonicalPath().equals(serverXML.getCanonicalPath())) { + scd = new ServerConfigDocument(log, serverXML, libertyDirPropertyFiles) } return scd @@ -520,8 +519,7 @@ abstract class AbstractServerTask extends AbstractLibertyTask { if (serverConfigFile != null && serverConfigFile.exists()) { try { Map props = combinedBootstrapProperties == null ? convertPropertiesToMap(server.bootstrapProperties) : combinedBootstrapProperties; - getServerConfigDocument(new CommonLogger(project), serverConfigFile, server.configDirectory, server.bootstrapPropertiesFile, props, server.serverEnvFile, - false, getLibertyDirectoryPropertyFiles(null)); + 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 diff --git a/src/main/groovy/io/openliberty/tools/gradle/tasks/DeployTask.groovy b/src/main/groovy/io/openliberty/tools/gradle/tasks/DeployTask.groovy index 92313838..cc9141b3 100644 --- a/src/main/groovy/io/openliberty/tools/gradle/tasks/DeployTask.groovy +++ b/src/main/groovy/io/openliberty/tools/gradle/tasks/DeployTask.groovy @@ -682,8 +682,7 @@ class DeployTask extends AbstractServerTask { File serverXML = new File(getServerDir(project).getCanonicalPath(), "server.xml") try { - scd = getServerConfigDocument(new CommonLogger(project), serverXML, server.configDirectory, - server.bootstrapPropertiesFile, combinedBootstrapProperties, server.serverEnvFile, false, 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) diff --git a/src/main/groovy/io/openliberty/tools/gradle/tasks/StartTask.groovy b/src/main/groovy/io/openliberty/tools/gradle/tasks/StartTask.groovy index 244d24b3..d952daeb 100644 --- a/src/main/groovy/io/openliberty/tools/gradle/tasks/StartTask.groovy +++ b/src/main/groovy/io/openliberty/tools/gradle/tasks/StartTask.groovy @@ -15,16 +15,11 @@ */ package io.openliberty.tools.gradle.tasks -import org.gradle.api.GradleException -import org.gradle.api.tasks.TaskAction -import org.gradle.api.Task -import org.gradle.api.logging.LogLevel import io.openliberty.tools.ant.ServerTask -import io.openliberty.tools.gradle.utils.* -import io.openliberty.tools.common.plugins.config.ServerConfigDocument import io.openliberty.tools.gradle.utils.CommonLogger - -import java.io.File +import org.gradle.api.GradleException +import org.gradle.api.Task +import org.gradle.api.tasks.TaskAction class StartTask extends AbstractServerTask { @@ -85,9 +80,7 @@ class StartTask extends AbstractServerTask { File serverConfigFile = new File(getServerDir(project), 'server.xml') if (serverConfigFile != null && serverConfigFile.exists()) { try { - Map props = combinedBootstrapProperties == null ? convertPropertiesToMap(server.bootstrapProperties) : combinedBootstrapProperties; - getServerConfigDocument(new CommonLogger(project), serverConfigFile, server.configDirectory, server.bootstrapPropertiesFile, props, server.serverEnvFile, - false, getLibertyDirectoryPropertyFiles(null)); + getServerConfigDocument(new CommonLogger(project), serverConfigFile, getLibertyDirectoryPropertyFiles(null)); if (scd != null) { appNames = scd.getNames() appNames += scd.getNamelessLocations().collect { String location -> diff --git a/src/main/groovy/io/openliberty/tools/gradle/tasks/UndeployTask.groovy b/src/main/groovy/io/openliberty/tools/gradle/tasks/UndeployTask.groovy index 3b66e588..9f02109c 100644 --- a/src/main/groovy/io/openliberty/tools/gradle/tasks/UndeployTask.groovy +++ b/src/main/groovy/io/openliberty/tools/gradle/tasks/UndeployTask.groovy @@ -79,8 +79,7 @@ class UndeployTask extends AbstractServerTask { File serverXML = new File(getServerDir(project).getCanonicalPath(), "server.xml") try { - getServerConfigDocument(new CommonLogger(project), serverXML, server.configDirectory, - server.bootstrapPropertiesFile, combinedBootstrapProperties, server.serverEnvFile, false, getLibertyDirectoryPropertyFiles(null)) + 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)