SpringBoot的2.1.8.RELEASE版本使用多少版本的spring-boot-starter-data-redis和spring-boot-starter-cache
时间: 2023-09-02 13:11:08 浏览: 918
在Spring Boot 2.1.8.RELEASE版本中,常用的`spring-boot-starter-data-redis`和`spring-boot-starter-cache`的版本是根据Spring Boot的版本进行管理的。可以通过查看Spring Boot官方文档或者 Maven Central Repository 来获取最新的版本信息。
一般情况下,Spring Boot的版本号和相应的starter版本号是对应的,可以使用相同的版本号进行依赖管理。例如,对于Spring Boot 2.1.8.RELEASE版本,推荐使用以下版本的starter:
- `spring-boot-starter-data-redis`:通常使用与Spring Boot相同版本的`spring-boot-starter-data-redis`,也就是2.1.8.RELEASE版本。
- `spring-boot-starter-cache`:同样使用与Spring Boot相同版本的`spring-boot-starter-cache`,即2.1.8.RELEASE版本。
请注意,这只是一般推荐的做法,具体版本号可能会因为不同的需求和场景而有所调整。建议查阅官方文档或者相关资源来获取最准确的版本信息。
相关问题
我用的springboot版本为2.1.8.RELEASE,spring-cloud-starter-openfeign引入就报错
好的,如果你使用的是 Spring Boot 2.1.8.RELEASE,那么你需要使用 Spring Cloud Greenwich 版本的依赖。你可以在你的 pom.xml 文件中添加以下依赖来引入 Spring Cloud Greenwich 版本的 OpenFeign:
```
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<version>Greenwich.SR3</version>
</dependency>
```
如果你已经引入了正确版本的依赖,但是仍然遇到了问题,可以尝试以下解决方案:
1. 确保你的 `@SpringBootApplication` 注解所在的类的包路径是正确的。如果你的 `@SpringBootApplication` 注解所在的类位于根包路径下,而其他组件的包路径却不是根包路径下,那么你需要在启动类上添加 `@ComponentScan` 注解,来指定其他组件的包路径,例如:
```
@SpringBootApplication
@ComponentScan(basePackages = "com.example.other")
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
```
2. 确保你的 `@EnableFeignClients` 注解所在的类的包路径是正确的。同样的,如果你的 `@EnableFeignClients` 注解所在的类位于根包路径下,而其他组件的包路径却不是根包路径下,那么你需要在 `@EnableFeignClients` 注解中指定其他组件的包路径,例如:
```
@SpringBootApplication
@EnableFeignClients(basePackages = "com.example.other")
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
```
3. 确保你的 Feign 接口定义的路径是正确的。例如,如果你的 Feign 接口定义的路径是 `/api/service`,那么你的请求 URL 应该是 `http://localhost:8080/api/service`,而不是 `http://localhost:8080/service`。
希望这些解决方案能够帮助你解决问题。
Project 'org.springframework.boot:spring-boot-starter-parent:2.1.8.RELEASE' not found
这个错误通常发生在 Maven 无法找到你指定的 Spring Boot Starter Parent 版本号时。你需要检查你的 pom.xml 文件中是否正确指定了版本号。
正确的 Spring Boot Starter Parent 依赖通常是这样的:
```xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.8.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
```
请确保你的依赖中 groupId、artifactId 和 version 都正确设置。如果版本号不正确,你可以尝试更新版本号,或者在 Maven 仓库中手动下载并安装所需的版本。
阅读全文
相关推荐















