如何在 grails 3+ 中启用 webapp 作为可分发的

How to enable webapp as distributable in grails 3+

How do i enable webapp to be distributable in grails 3+ since there is no web.xml?

第 1 步:前往 src\main\webapp\WEB-INF 位置。 (如果没有,创建路径)
第 2 步:创建文件夹 WEB-INF
第 3 步:创建文件 web.xml 并粘贴以下代码

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
         metadata-complete="true"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

    <distributable/>

</web-app>

第 4 步:生成 war 并在 tomcat 服务器上部署 war 文件。

希望有用