diff --git a/src/main/groovy/net/wasdev/wlp/gradle/plugins/tasks/AbstractServerTask.groovy b/src/main/groovy/net/wasdev/wlp/gradle/plugins/tasks/AbstractServerTask.groovy index b5f30344a..2120f18bd 100644 --- a/src/main/groovy/net/wasdev/wlp/gradle/plugins/tasks/AbstractServerTask.groovy +++ b/src/main/groovy/net/wasdev/wlp/gradle/plugins/tasks/AbstractServerTask.groovy @@ -364,7 +364,7 @@ abstract class AbstractServerTask extends AbstractTask { serverNode.appendNode('installAppsConfigDropins', installAppsConfigDropinsFile.toString()) } } else { - if (!isAppConfiguredInSourceServerXml(getArchiveName(task))) { + if (!isAppConfiguredInSourceServerXml(getArchiveName(task)) || hasConfiguredApp(ApplicationXmlDocument.getApplicationXmlFile(getServerDir(project)))) { serverNode.appendNode('installAppsConfigDropins', installAppsConfigDropinsFile.toString()) } } @@ -515,5 +515,15 @@ abstract class AbstractServerTask extends AbstractTask { else { throw new GradleException("Archive path not found. Supported formats are jar, war, and ear.") } - } + } + + //Checks if there is an app configured in an existing configDropins application xml file + protected boolean hasConfiguredApp(File applicationXmlFile) { + if (applicationXmlFile.exists()) { + ApplicationXmlDocument appXml = new ApplicationXmlDocument() + appXml.createDocument(applicationXmlFile) + return appXml.hasChildElements() + } + return false + } } diff --git a/src/main/groovy/net/wasdev/wlp/gradle/plugins/tasks/InstallAppsTask.groovy b/src/main/groovy/net/wasdev/wlp/gradle/plugins/tasks/InstallAppsTask.groovy index a37930896..1e9bb85c0 100644 --- a/src/main/groovy/net/wasdev/wlp/gradle/plugins/tasks/InstallAppsTask.groovy +++ b/src/main/groovy/net/wasdev/wlp/gradle/plugins/tasks/InstallAppsTask.groovy @@ -312,20 +312,8 @@ class InstallAppsTask extends AbstractServerTask { } } - //Checks if there is an app configured in an existing configDropins application xml file - private boolean hasConfiguredApp(File applicationXmlFile) { - if (applicationXmlFile.exists()) { - ApplicationXmlDocument appXml = new ApplicationXmlDocument() - appXml.createDocument(applicationXmlFile) - return appXml.hasChildElements() - } - return false - } - void createApplicationFolder(String appDir) { - File serverDir = getServerDir(project) - File applicationDirectory = new File(serverDir, appDir) - + File applicationDirectory = new File(getServerDir(project), appDir) try { if (!applicationDirectory.exists()) { applicationDirectory.mkdir()