【发布时间】:2021-08-12 10:22:37
【问题描述】:
我父模块中的spring boot版本是v2.1.17.RELEASE
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.1.17.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
然后我在子模块中引入了spring-boot-starter-security,指定版本为2.4.4,覆盖了父模块中的版本(v2.1.17.RELEASE)。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<version>2.4.4</version>
</dependency>
然后,我运行mvn dependency:tree命令,发现子模块中spring-boot-starter-security的版本确实是2.4.4,但是中引用的artifactId(如spring-aop)的版本spring-boot-starter-security 仍然是 5.1.x 版本,它对应于 spring-boot-starter-security 的 v2.1.17.RELEASE 版本,而不是对应于 v2.4.4 版本的 spring-boot 的 5.3.x 版本-starter-安全
【问题讨论】:
标签: spring spring-boot maven spring-security spring-boot-starter