To allow to change generated WAR name by a Grails 3.X app, the Gradle task war could be used to assign a custom name.
In order to do this, in build.gradle file, the following task needs to be added:
Where war_name could be such as:
It could be also another fixed named or based on a variable. If the name want to be based on rootProject.name this tutorial is useful.
To make it works with the former examples, the project needs a based name. To do this, a settings.gradle file has to be created, at the same level as the build.gradle file, with the following content:
Therefore, war.baseName y rootProject.name will have the name specified in this variable.