简体   繁体   English

Grails Spring Security插件-插件目录在哪里?

[英]Grails Spring Security Plugin - Where is the plugin directory?

I am relatively new to Grails and currently I busy myself with the Spring-Security UI plugin. 我对Grails不太熟悉,目前我忙于Spring-Security UI插件。 After reading the documentation I want to make some adjustments at the property file grails-app/i18n/messages.spring-security-ui.properties , but I can't find the properties file. 阅读文档后,我想对属性文件grails-app / i18n / messages.spring-security-ui.properties进行一些调整,但找不到属性文件。 Neither in the project-directory, either in the plugins directory. 既不在项目目录中,也不在插件目录中。

I have even tried to search it with the unix-command find in my project. 我什至尝试用我项目中的unix命令find搜索它。 ( find . -name 'messages.spring-security-ui.properties' ) 找到。-name'messages.spring-security-ui.properties'

Do I have to use the s2ui-override command to generate the spring-security-ui directory and its properties files? 我是否必须使用s2ui-override命令生成spring-security-ui目录及其属性文件?

I have installed the ui-plugin by modifying the BuildConfig.groovy ( compile ":spring-security-ui:0.2" ) and using the command grails compile . 我已经通过修改BuildConfig.groovy( 编译“:spring-security-ui:0.2” )并使用grails compile命令安装了ui插件。

Thank you in advance. 先感谢您。

Best 最好

The plugins are installed on your local user folder, example: 插件安装在您的本地用户文件夹中,例如:

~/.grails/2.0.4/projects/grailsdevs/plugins/

where: 哪里:

grailsdevs = project name

By the way, you can override the messages properties in your project ones. 顺便说一句,您可以覆盖项目属性中的message属性。

check the messages you can use: 检查您可以使用的消息:

http://grails-plugins.github.com/grails-spring-security-core/docs/manual/guide/25%20Internationalization.html http://grails-plugins.github.com/grails-spring-security-core/docs/manual/guide/25%20Internationalization.html

You don't have to override the plugin because the plugin is installed locally, if you run the app in another computer the plugin will be installed from the repository. 您不必覆盖该插件,因为该插件是在本地安装的,如果您在另一台计算机上运行该应用程序,则将从存储库中安装该插件。 So the best way you can do this is add the messages in your i18n resource bundle. 因此,执行此操作的最佳方法是将消息添加到i18n资源束中。

Go to your project... under folder: grails-app/i18n/ 转到您的项目...,位于文件夹:grails-app / i18n /下

Hope this help you 希望这对您有帮助

Don't edit plugin files. 不要编辑插件文件。

If you want a different I18N message for a key, add that line to your application's messages.properties (and the other locale files if you support multiple languages). 如果您想要不同的I18N消息作为密钥,则将该行添加到应用程序的messages.properties (以及其他语言环境文件(如果您支持多种语言)中)。 The application's files take precedence over plugin files 应用程序的文件优先于插件文件

Just use the same key and whatever message you want to display. 只需使用相同的键以及您想要显示的任何消息即可。

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

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