Error while creating a WAR file

I am trying to create a WAR file following the instructions…

groovytask buildWar(type: CubaWarBuilding) {
        appHome = '..'
        webXmlPath = 'modules/web/web/WEB-INF/single-war-web.xml'

to the build.gradle file.
However, I get the error below:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. [11:36:03.171] Exception has been thrown by
[11:36:03.173] org.gradle.api.internal.MissingMethodException: Could not find method buildWar() for arguments [{type=class CubaWarBuilding}, build_96lwv5jerwxq41e5rxenuk63v$_run_closure6$_closure31@1ed64b4e] on root project 'AzureTest2'. 

I am using Studio Version 6.3.0
Build: 2016-10-20

Am I missing something?



Could you share your build.gradle code?