Grails 4 WAR文件混乱 [英] Grails 4 WAR file confusion

查看:76
本文介绍了Grails 4 WAR文件混乱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Grails应用程序,我已经从3.3.0升级到4.0.3. 在我的build.gradle文件中,有以下内容

I have a Grails application that I have upgraded from 3.3.0 to 4.0.3. In my build.gradle file I have the following

war {
    archiveName 'Wolf.war'
}

在版本3中,按预期方式运行"grails war"时,它将命名为我的战争文件Wolf.war.但是,在Grails 4中,这不再适用于我.我知道这与Gradle有关.我有Gradle 5.1.1,并且每个

In version 3, this would name my war file Wolf.war when running "grails war" just as expected. However, in Grails 4 this no longer works for me. I know this is related to Gradle. I have Gradle 5.1.1, and per the docs the archiveName property is deprecated (but should still work?).

我的问题是,在使用Gradle 5(或更高版本)的Grails 4应用程序中,强制使用"grails war"命令生成的战争文件的名称的正确方法是什么?

My question is, what is the proper way, in a Grails 4 app using Gradle 5 (or above?) to force the name of the war file being produced by the "grails war" command?

推荐答案

假定您使用的是默认的构建配置,则应使用bootWar而不是war.

Assuming you are using the default build config, you should use bootWar instead of war.

bootWar {
    archiveName 'Wolf.war'
}

这篇关于Grails 4 WAR文件混乱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆