How to explicitly specify the path to and name of a .war file when deploying?

When deploying a .war using the cargo plugin, I want to explicitly set the full path to and the name of the .war file.

How do I do this?

It defaults to <my_projeject>/app/build/libs/app.war

I tried creating a closure:

war {

archiveName=’/tmp/test.war’ }

but then I get an error:

<my_proj>/app/build/libs/tmp/test.war does not exist.

This is frustrating if anyone can help, the cargo documentation mentions nothing of the war { clousure or how to explicitly set the name of the war file to be deployed.

Any help would be appreciated.

As indicated by the plugin documentation, you can use the “deployable” configuration block.


cargo {
    deployable {
        file = file('/app/build/libs/tmp/test.war')
        context = 'yourcontext'

awesome, thanks, I will give it a go; is there a field to specify a URL (path to a .war, fetch with http:// ?)

Not at the moment. You will have to download it first to your local file system. The most convenient way to do this is to write a Gradle task that retrieves it via HTTP.