简体   繁体   English

Grails - 卸载 Spring 安全核心

[英]Grails - uninstalling Spring Security Core

What is the correct way to uninstall spring-security-core plugin completely?完全卸载 spring-security-core 插件的正确方法是什么? I'm working on a Grails app that no longer needs a login and I'd like to remove it.我正在开发一个不再需要登录的 Grails 应用程序,我想将其删除。

Even though I have uninstalled it via:即使我已经通过以下方式卸载了它:

grails uninstall-plugin spring-security-core grails 卸载插件 spring-security-core

Plugin [spring-security-core-1.1.3] is installed, but was not found in the application's metadata, do you want to uninstall?插件 [spring-security-core-1.1.3] 已安装,但未在应用程序的元数据中找到,要卸载吗? [y,n] My choice doesn't seem to effect anything. [y,n] 我的选择似乎没有任何影响。

I keep getting message "Configuring Spring Security..." when starting application.启动应用程序时,我不断收到消息“正在配置 Spring 安全性...”。

uninstall-plugin should work, but you can do it manually. uninstall-plugin应该可以工作,但您可以手动完成。 Edit application.properties and remove the line for the plugin, then delete the directory under $HOME/.grails/<grails version>/projects/<your project>/plugins .编辑application.properties并删除插件的行,然后删除$HOME/.grails/<grails version>/projects/<your project>/plugins下的目录。 Then run grails clean to remove any old classes.然后运行grails clean以删除所有旧类。

In general this will work, as long as the plugin doesn't do any work in its _Uninstall.groovy script, which is the case for Spring Security Core (it's empty).一般来说,只要插件在其_Uninstall.groovy脚本中没有做任何工作,这将起作用,Spring 安全核心就是这种情况(它是空的)。

You should also make sure you clean up any references to Spring Security beans that you may have used.您还应该确保清除您可能使用过的对 Spring 安全 bean 的所有引用。 For example, if you are injected springSecurityService into your controllers/services/etc to retrieve the currently logged in user - you will now find missing beans on startup/null pointer exceptions例如,如果您将 springSecurityService 注入到您的控制器/服务/等中以检索当前登录的用户 - 您现在将在启动/空指针异常时发现丢失的 bean

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

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