Java EnableConfigServer无法解析为类型
我想通过添加@EnableConfigServer连接我的spring云配置服务器,但得到的错误是无法将EnableConfigServer解析为类型。已经检查了application.properties、name、git存储库路径,我也已经尝试清理项目,但仍然遇到相同的错误。我无法查看localhost:8888/limits service/default。请帮助我 这是我的pom.xmlJava EnableConfigServer无法解析为类型,java,git,eclipse,spring-boot,config,Java,Git,Eclipse,Spring Boot,Config,我想通过添加@EnableConfigServer连接我的spring云配置服务器,但得到的错误是无法将EnableConfigServer解析为类型。已经检查了application.properties、name、git存储库路径,我也已经尝试清理项目,但仍然遇到相同的错误。我无法查看localhost:8888/limits service/default。请帮助我 这是我的pom.xml <?xml version="1.0" encoding="UTF-8"?> <p
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.samazlan.microservices</groupId>
<artifactId>spring-cloud-config-server</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>spring-cloud-config-server</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<spring-cloud.version>Hoxton.SR1</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<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>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</project>
4.0.0
org.springframework.boot
spring启动程序父级
2.2.4.1发布
com.samazlan.microservices
spring云配置服务器
0.0.1-快照
spring云配置服务器
SpringBoot的演示项目
1.8
Hoxton.SR1
org.springframework.cloud
SpringCloudStarter配置
org.springframework.boot
弹簧靴开发工具
运行时
真的
org.springframework.boot
弹簧起动试验
测试
org.junit.vintage
朱尼特老式发动机
org.springframework.cloud
spring云依赖关系
${spring cloud.version}
聚甲醛
进口
org.springframework.boot
springbootmaven插件
src/main/resources
真的
您可以尝试清理本地.m2 maven缓存
(重命名它,强制maven重新创建一个新的m2文件夹)。查看是否导入了依赖项。@samazlan只需重命名~/.m2文件夹(请参阅)。然后重新启动maven构建。