【发布时间】:2018-11-20 03:30:51
【问题描述】:
我有一个 xml 配置,当我尝试导入 spring-security 命名空间时,它给了我 2 个选择:springframework.org/schema/p 和 springframework.org/schema/c。我需要的是:http://www.springframework.org/schema/security(找不到)。这是一个spring boot项目,我需要用xml配置安全性。我想我缺少一些依赖,但我不确定是哪一个。
这是xml配置文件:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd"
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security.xsd">
以及 build.gradle 依赖:
dependencies {
compile('org.springframework.boot:spring-boot-starter-aop')
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-security')
compile('org.springframework.boot:spring-boot-starter-web')
runtime('org.postgresql:postgresql')
testCompile('org.springframework.boot:spring-boot-starter-test')
testCompile('org.springframework.security:spring-security-test')
compile group: 'org.springframework', name: 'spring-jdbc', version: '5.0.6.RELEASE'
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.0'
compile group: 'org.springframework.security', name: 'spring-security-config', version: '5.0.5.RELEASE'
}
【问题讨论】:
标签: spring spring-boot gradle spring-security xml-configuration