pom.xml中引入一下代碼會覆蓋引入jar的版本
<dependencyManagement>
<dependencies>
<dependency>
<groupId>xxx</groupId>
<artifactId>xxx</artifactId>
<version>xxx</version>
<scope>xxx</scope>
</dependency>
</dependencies>
</dependencyManagement>
比如需要在Springboot項目中使用spring-messaging 這個5.2.6.RELEASE版本的的jar信息。原來SpringBoot中已存在4.3.4這個版本。那麼我們只需要這麼做即可
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-messaging</artifactId>
<version>5.2.6.RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>
</dependencyManagement>