maven dependency version matching

respond to the situation

For example, spring-session-data-redisthere is dependency ② in dependency ① spring-data-redis, and the version is 1.7.10.RELEASE, but because the version of dependency ② does not have a certain function, a new version of dependency ② needs to be used.

insert image description here

Dependencies put into 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>

Dependent selection steps

Maven warehouse URL

Find the dependency, and then select the version
insert image description here
insert image description here
to view the available range of the dependency.
insert image description here
You can see spring-data-redisthe range of use 1.7.10.RELEASEto3.0.2

Guess you like

Origin blog.csdn.net/PhilsphyPrgram/article/details/129204599