Specifing package for ShiroUser in Grails

僤鯓⒐⒋嵵緔 提交于 2019-12-11 12:05:44

问题


Very very basic question. Is there a way to specify the package (when doing shiro-quick-start) where to place ShiroUser and ShiroRole classes at? By default they are placed at grails-app/domain/ and I want them at /grails-app/domain/com/bla/bla. Netbeans' refactoring tool is useless when trying to move those classes.

Thanks.


回答1:


Well it doesn't seem possible to have it out of the box.

You might have a temporary solution that consists in:

  1. Install shiro plugin as an inplace plugin (see here) : Uninstall shiro plugin, download shiro plugin zip file and unzip it under MyProject/. . Then modify BuildConfig.groovy file and add grails.plugin.location.'shiro' = "shiro"
  2. Modifying _ShiroInternal.groovy script from shiro/scripts folder and especially line having code def artefactPath = "grails-app/domain". Here you can append a argsMap['package'] if it was specified by user command parameters
  3. Submit your patch (after test) to the plugin source code. This way you will contribute back to the community and to this amazing plugin AND you will get benefit to have your patch included in the next release (and remove the inplace plugin setup)



回答2:


I think the answer to do this is:

grails shiro-quick-start **--prefix=org.example.mypackage.**

I hope that helps...

plugin description and installation



来源:https://stackoverflow.com/questions/6917127/specifing-package-for-shirouser-in-grails

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!