应对情况
例如spring-session-data-redis
依赖①里有spring-data-redis
依赖②,版本为1.7.10.RELEASE
,但是因为依赖②版本没有某一功能,需要使用依赖②新的版本。
放入到pom中的依赖
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
<version>1.3.1.RELEASE</version>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
</exclusion>
<exclusion>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<version>1.8.0.RELEASE</version>
</dependency>
依赖选取步骤
找到依赖,然后选取版本
查看依赖可使用范围
可以看出spring-data-redis
使用范围 1.7.10.RELEASE
到 3.0.2