spring cloud server 的pom.xml例子

阅读更多

         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  4.0.0

  xxxx
  xxxx
  1.0-SNAPSHOT

 
    org.springframework.boot
    spring-boot-starter-parent
    1.5.10.RELEASE
 



 
    UTF-8
    UTF-8
    1.8
 

 
   
      org.springframework.cloud
      spring-cloud-starter-eureka-server
   

   
      com.netflix.eureka
      eureka-client
      1.6.2
   

   
      com.thoughtworks.xstream
      xstream
      1.4.10
   

 

 
   
     
        org.springframework.cloud
        spring-cloud-dependencies
        Dalston.SR1
        pom
        import
     

   

 






最主要是要有
com.netflix.eureka 和 com.thoughtworks.xstream






import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;

@EnableEurekaServer
@SpringBootApplication
public class EurekaServerApplication{

  public static void main(String[] args) {
    new SpringApplicationBuilder(EurekaServerApplication.class)
            .web(true).run(args);
  }
}


application.properties
的内容如下:

spring.application.name=eureka-server
server.port=1001
eureka.instance.hostname=localhost
eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false


运行成功后,就可以通过http://127.0.0.1:1001看到 spring cloud server Eureka

你可能感兴趣的:(spring,cloud,Eureka,server,maven)