springCloud(二) eureka客户端搭建

2021-01-16 10:11

阅读:740

标签:java   desc   文件   framework   conf   snapshot   des   eureka   ups   

1:pom.xml

4.0.0org.springframework.boot
		spring-boot-starter-parent
		2.3.0.RELEASEcom.imooc
	demo
	0.0.1-SNAPSHOTdemoDemo project for Spring Boot1.8Hoxton.SR4aliyun-nexushttp://maven.aliyun.com/nexus/content/groups/public/aliyun-publichttps://maven.aliyun.com/repository/publicorg.springframework.boot
			spring-boot-starter-web
		org.springframework.cloud
			spring-cloud-starter-netflix-eureka-client
		org.springframework.boot
			spring-boot-starter-test
			testorg.junit.vintage
					junit-vintage-engine
				org.springframework.cloud
				spring-cloud-dependencies
				${spring-cloud.version}pomimportorg.springframework.boot
				spring-boot-maven-plugin
			

2.applocation.yml 文件

server:
  port: 80
spring:
  application:
    name: order-service
eureka:
  client:
    service-url:
      defaultZone:
        http://localhost:8761/eureka/

3.启动类

package com.imooc.EurekaClient;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;

@SpringBootApplication
@EnableEurekaClient
public class EurekaClientApplication {

   public static void main(String[] args) {
       SpringApplication.run(EurekaClientApplication.class, args);
   }

}

4.效果图

技术图片

springCloud(二) eureka客户端搭建

标签:java   desc   文件   framework   conf   snapshot   des   eureka   ups   

原文地址:https://www.cnblogs.com/guhualin/p/12926810.html


评论


亲,登录后才可以留言!