Spring Security需要哪些依赖
时间: 2024-02-22 17:32:16 浏览: 162
使用Spring Security框架需要添加以下依赖:
```xml
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.5.1</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>5.5.1</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>5.5.1</version>
</dependency>
```
其中,`spring-security-core`是Spring Security的核心库,`spring-security-config`提供了一些常用的配置类,`spring-security-web`提供了一些在Web应用程序中使用的安全过滤器和相关的Web安全机制。如果需要使用Spring Security的表单登录、记住我等功能,则还需要添加以下依赖:
```xml
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-form-login</artifactId>
<version>5.5.1</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-remember-me</artifactId>
<version>5.5.1</version>
</dependency>
```
阅读全文