简体   繁体   English

如何将Grails 2插件资源复制到Grails应用程序?

[英]How to copy Grails 2 plugin resources to the Grails app?

I'm writing a custom Grails 2 plugin to modularize my Grails applications. 我正在编写一个自定义的Grails 2插件来模块化我的Grails应用程序。 In the plugin I'm planning to define basic GSPs that can be overridden by the application that will utilize the plugin. 我打算在插件中定义基本的GSP,这些基本GSP可以被使用该插件的应用程序所覆盖。 I'm thinking of writing a Grails command script that copies those GSPs into the grails-app directory of the app the plugin is installed in. If in the plugin, I put those GSPs in grails-app/views , how do I refer to the actual Grails app directory in the Grails command script, which is also grails-app/views ? 我正在考虑编写Grails命令脚本,该脚本会将这些GSP复制到安装了插件的应用程序的grails-app目录中。如果在插件中,我将这些GSP放在grails-app/views ,我该如何参考Grails命令脚本中实际的Grails应用程序目录,它也是grails-app/views吗?

The solution to this is almost the same as this answer . 解决的方法与此答案几乎相同。 The built-in properties basedir and <plugin_name>PluginBaseDir differentiate the target app and the plugin directories. 内置属性basedir<plugin_name>PluginBaseDir区分目标应用程序和插件目录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM