gpt4 book ai didi

Grails:当扩展不应该是构建的一部分时,如何将扩展与主 war 文件捆绑在一起?

转载 作者:行者123 更新时间:2023-12-02 15:32:28 24 4
gpt4 key购买 nike

我有一些客户扩展必须作为单独的模块(例如:grails 插件)实现,并且应该在部署时使用应用程序引导/配置,但不包含在最终的 war 文件中。

该插件不必在运行时加载,它只是不必包含在 war 文件中,并且仍然能够与主应用程序服务进行通信。

我知道我可以在 BuildConfig.groovy 中将插件的位置指定为 grails docs

An application can load plugins from anywhere on the file system, even if they have not been installed. Specify the location of the (unpacked) plugin in the application's grails-app/conf/BuildConfig.groovy file:



但我希望能够从构建的 WAR 文件中排除插件。

我认为解决这个问题的方法是使用二进制插件,它会生成一个 jar,并使用 classLoader 来加载插件。

请给我您的宝贵建议,因为我找不到一个好的解决方案。

提前致谢!

最佳答案

如果标记正确,您的用例类似于 grails tomcat默认情况下嵌入在 grails 应用程序中的插件。方法如下:

  • 在构建过程中使用。
  • 不包装在 war 中。
  • 未在运行时加载。
  • 充当应用程序的嵌入式服务器。

  • 推断:
    您可以在 build 中使用您的插件吗?配置同 tomcat ?
    //BuildConfig.groovy
    ....
    plugins{
    build ':yourPlugun:1.0'
    }
    ....

    关于Grails:当扩展不应该是构建的一部分时,如何将扩展与主 war 文件捆绑在一起?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17475541/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com