Spring Boot 2.0.3缺少Spring Security的oauth2'dependencies.dependency.version'

时间:2018-07-28 10:51:56

标签: spring spring-boot maven-3

我尝试添加spring安全性的依赖关系。 这是我的pom.xml

<properties>        
    <spring-boot.version>2.0.3.RELEASE</spring-boot.version>
</properties>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-dependencies</artifactId>
            <version>${spring-boot.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    ...
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.security.oauth</groupId>
        <artifactId>spring-security-oauth2</artifactId>
    </dependency>
    ...
<dependencies>

我尝试使用artifactId spring-security-oauth2,它说: org.springframework.security.oauth:spring-security-oauth2:jar的'dependencies.dependency.version'丢失

但使用弹簧1.4.2.RELEASE,它可以工作。 springboot 2.0.3.RELEASE的新的spring security oauth2 maven repo是什么? (无元素) 谢谢

1 个答案:

答案 0 :(得分:6)

错误提示您尚未为spring-security-oauth2定义版本

您可以使用2.3.3版本

    <dependency>
        <groupId>org.springframework.security.oauth</groupId>
        <artifactId>spring-security-oauth2</artifactId>
        <version>2.3.3.RELEASE</version>
    </dependency>