当我尝试启用EurekaServer时,代码未正确编译。 我验证了POM.xml中的依赖关系似乎很好。 导入org.springframework.cloud.netflix.eureka.EnableEurekaServer;无法解决
****code :snippet****
package com.Myproj.MicroServices.netflixeurekanamingserver;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaServer;
@SpringBootApplication
@EnableEurekaServer
public class NetflixEurekaNamingServerApplication {
public static void main(String[] args) {
SpringApplication.run(NetflixEurekaNamingServerApplication.class, args);
}
}
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-eureka-server</artifactId>
<version>1.1.6.RELEASE</version>
</dependency>