renren-fast启动失败,springboot与springcloud版本不匹配问题解决

在启动renren-fast时候,导入common模块以后,项目直接报错,任何一个服务都无法启动,看报错是循环依赖,找不到模块的问题。
在这里插入图片描述
这里我选择单独引入nacos等依赖,并修改renren-fast的springboot版本为2.7.4:

				<dependency>
				<groupId>org.springframework.cloud</groupId>
				<artifactId>spring-cloud-starter-bootstrap</artifactId>
					<version>3.1.2</version>
				</dependency>
		        <dependency>
		            <groupId>com.alibaba.cloud</groupId>
		            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
		            <exclusions>
		                <exclusion>
		                    <groupId>org.springframework.cloud</groupId>
		                    <artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
		                </exclusion>
		            </exclusions>
		            <version>2021.1</version>
		        </dependency>
		        <dependency>
		            <groupId>com.alibaba.cloud</groupId>
		            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
		            <version>2021.1</version>
		        </dependency>

启动报错:

Your project setup is incompatible with our requirements due to following reasons:

- Spring Boot [2.7.4] is not compatible with this Spring Cloud release train

这里应该是renren-fast的cloud版本和springboot版本不一致问题了

修改springcloud和springcloudAlibaba的版本:

	<dependencyManagement>

		<dependencies>
			<dependency>
				<groupId>org.springframework.cloud</groupId>
				<artifactId>spring-cloud-dependencies</artifactId>
				<version>2021.0.3</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>

			<dependency>
				<groupId>com.alibaba.cloud</groupId>
				<artifactId>spring-cloud-alibaba-dependencies</artifactId>
				<version>2021.1</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

这里需要注意的是,如果直接把<dependency>放到<dependencies>中,还是会报错,没有起到作用,这里需要放到</dependencyManagement>里面,盲猜是由于依赖管理的优先级较高,可以修改renren-fast的cloud相关版本。

启动成功:
在这里插入图片描述

参考链接:
renren-fast启动失败

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值