spring boot工程修改成spring cloud工程步骤

S1:启动类添加注解

@EnableEurekaClient

S2:添加pom依赖文件

spring boot工程修改成spring cloud工程步骤_第1张图片

Finchley.SR1

    
        
            org.springframework.cloud
            spring-cloud-dependencies
            ${spring-cloud.version}
            pom
            import
        
    

放在之上;



    org.springframework.cloud
    spring-cloud-config-server
    2.0.2.RELEASE



    org.springframework.cloud
    spring-cloud-starter-config
    2.0.2.RELEASE



    org.springframework.cloud
    spring-cloud-starter-netflix-eureka-client
    2.0.2.RELEASE
    compile



    org.springframework.cloud
    spring-cloud-starter-netflix-hystrix
    2.0.2.RELEASE

 

S3:添加配置文件

spring boot工程修改成spring cloud工程步骤_第2张图片

 

 

运行成功:OK

 

 

 

 

你可能感兴趣的:(java)