赞
踩
Error creating bean with name ‘configurationPropertiesBeans‘ defined in class path resource
看了别人的pom配置,发现根本问题是没有在properties中指定springcloud的版本
如果不指定springcloud版本,即时自动匹配版本也会报错
操作步骤:
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<spring-cloud.version>2021.0.1</spring-cloud.version>
</properties>
我这里用的2.6.4的springcloud对应的版本是2021.0.1 具体版本参考这位老哥的
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
如果是在一个工程里的,pom中就是这样
<properties> <maven.compiler.source>8</maven.compiler.source> <maven.compiler.target>8</maven.compiler.target> <spring-cloud.version>2021.0.1</spring-cloud.version> </properties> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId> </dependency> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>${spring-cloud.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。