Hi Team,
With 8 version below code is not working. I removed overwrite true. however getting couldnt create the taks which is not exists.
Could not create task ':deployServiceAppEnforcementCGPAHTTPServletApp'.
> Unnecessarily replacing a task that does not exist is not supported. Use create() or register() directly instead. You attempted to replace a task named 'deployServiceAppEnforcementCGPAHTTPServletApp', but there is no existing task with that name.
what is alternative way to replace tasks.create overwrite. Can you please help me on this.
allApps.each { thisApp ->
def taskName = "generate" + thisApp.name + thisApp.apptype + "App"
def deployTaskName = "deployServiceApp" + thisApp.name
def thisAppBaseDir = file(GENERATED_APPS_DIR.absolutePath + "/" + thisApp.name)
tasks.create(name: taskName, type: Class.forName("xxx.xx.xx.Generate" + thisApp.apptype + "ServiceApp"), overwrite: true) {
app thisApp
}
tasks.create(name: deployTaskName, dependsOn: project.tasks."${taskName}", overwrite: true) {
doLast{
if(topoId.equals("LayerMT")){
SERVICE_TARGET = CLUSTER_NAME
}
deployApp(appName: thisApp.name, appPath: GENERATED_APPS_DIR.absolutePath + File.separator + thisApp.name + File.separator + "dist" + File.separator + thisApp.name + ".war", targets: SERVICE_TARGET)
}
}
currentTask.dependsOn deployTaskName
}
}