spring-boot - 在 Spring Boot 2.0.2 中禁用 Spring Security
问题描述
security.ignore=/**
我正在尝试通过添加属性来禁用 Spring Boot 2.0.2 中的 Spring Security,但它不适用于我。
我的应用程序属性:
spring.datasource.url = jdbc:mysql://localhost:3306/smile
spring.datasource.username = root
spring.datasource.password =
spring.datasource.driverClassName = com.mysql.jdbc.Driver
spring.jpa.hibernate.ddl-auto = update
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
# suppress inspection "SpringBootApplicationProperties"
security.ignored=/**
结果:
解决方案
在您的主文件 Spring Boot 应用程序中添加此 Java Annotations。
@EnableAutoConfiguration(exclude = {
SecurityAutoConfiguration.class
})
推荐阅读
- python - 写入容器内的文件
- python - Pandas IndexError:处理多级文件时列表索引超出范围
- python - 使用 Autoscaling 组的 AWS Metric 的 AWS Lambda 函数
- javascript - Javascript新日期();输出
- reactjs - 单击链接时,使用的方法“滚动顶部”是否有任何替代方法?
- latex - 如何在 LaTeX 中获得通过将一个字符放在另一个表面上而产生的符号?
- c# - 使用 C# 为 Word 文档创建 FindNext 函数
- linux - tesseract 不在 PATH 中或未安装
- xml - 删除不符合条件的 XML 文件部分 - 使用 bash
- laravel - 错误:在 Heroku 上部署我的 Laravel 应用程序后,我的 CSS 文件无法加载