我在我的pom.xml中使用以下版本。我想使用spring-security-oauth2-autoconfigure: 2.1.9.RELEASE但是maven使用的当前版本是2.1.2.RELEASE.如何排除由org.springframework.cloud.
导入的版本?托管版本为2.1.2。RELEASE工件被管理在org.springframework.cloud: spring-cloud-openfeign-dependencies: 3.0.3
<dependencies>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.4</version>
</parent>
<dependency>
<groupId>org.springframework.security.oauth.boot</groupId>
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>2020.0.3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
尝试按如下方式指定版本:
<dependency>
<groupId>org.springframework.security.oauth.boot</groupId>
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
<version>2.1.9.RELEASE</version>
</dependency>
或者尝试如下设置版本:
<properties>
<spring-security-oauth2-autoconfigure.version>2.1.9.RELEASE</spring-security-oauth2-autoconfigure.version>
</properties>