Specifying WAR filename

I’m migrating an old configuration to both 6 → 7.5 version and from Groovy to Kotlin DSL.
All goes well, but one line of code: specifying the name of the war file.

In the old code it was straightforward:

war {
    archiveFileName = 'callisto-backend.war'
}

I know, that the file name falls into smaller blocks (baseName for example), so now I should set the baseName instead (without the extension. However, the new WarPluginConvension is no longer supports archive name, and in the task configuration, the archive name is already read-only.

How to set up the WAR name? (Also, as I see that the WarPluginConvension is deprecated, how to do it properly?)

Thanks!

You can still set archiveFileName on the war task. You don’t need to rely on the individual parts unless you want to. The archiveFileName is a Property though, so you should use the set method explicitly from the Kotlin DSL since you can’t use some of the Groovy shortcuts. This Kotlin DSL equivalent should be:

tasks.war {
    archiveFileName.set("callisto-backend.war")
}