Why did the version of spring-data-redis become 2.1.21.RELEASE instead of the expected 2.1.4.RELEASE version after I modified the version of spring-data-redis in the pom.xml file of spring-data-redis to 2.1.4.RELEASE, recompiled the spring-boot-starter-data-redis to version 2.1.19.BUILD-SNAPSHOT, installed it locally, and referenced it in the new project fm_hello?
Here is the modified content in the pom.xml file of spring-boot-starter-data-redis that I mentioned earlier:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<version>2.1.4.RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
</dependency>
Here is the command used to install it locally:
mvn clean install -DskipTests
Here is how I imported spring-boot-starter-data-redis in my fm_hello project:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.1.19.BUILD-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<version>2.1.19.BUILD-SNAPSHOT</version>
</dependency>
</dependencies>
Comment From: light-dot
This screenshot shows the dependencies in the fm_hello project
Comment From: wilkinsona
I can't tell for certain from the information provided, but I would guess that you are using dependency management (either through spring-boot-starter-parent or spring-boot-dependencies) in your project. This dependency management is managing the version of org.springframework.data:spring-data-redis and has overridden the version that org.springframework.boot:spring-boot-starter-data-redis:2.1.19.BUILD-SNAPSHOT would use by default. This is Maven's standard behavior when dependency management is in use.
If you have any further questions, please follow up on Stack Overflow or Gitter. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.
Also, please note that Spring Boot 2.1 is no longer supported. Please upgrade to 2.7.x or later as soon as possible.
Comment From: light-dot
Thank you for your help. I globally searched for a spring-boot-starter-parent and spring-boot-dependencies but did not find any mention of the version 2.1.21.RELEASE. I have posted this question on Stack Overflow, hoping that some experts can help me resolve it. https://stackoverflow.com/q/75731697/9478474