zoukankan      html  css  js  c++  java
  • Spring Cloud

    springboot 使用2.0以上版本的时候,应该使用 Finchley 版本的cloud 

    pom.xml

    <?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <groupId>com.chry</groupId>
      <artifactId>springcloud.helloworld.eureka.server</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <packaging>jar</packaging>
      <name>springcloud.helloworld.Eureka.server</name>
      <description>Demo Spring Eureka Server</description>
    
        <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>2.1.4.RELEASE</version>
            <relativePath/> <!-- lookup parent from repository -->
        </parent>
    
        <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
            <java.version>1.8</java.version>
        </properties>
    
        <dependencies>
            <!--eureka server -->
              
            <!--springcloud中eureka支持包-->
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
            </dependency> 
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-config</artifactId>
            </dependency>
            <!-- spring boot test-->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-test</artifactId>
                <scope>test</scope>
            </dependency>
        </dependencies>
    
        <dependencyManagement>
            <dependencies>
                <dependency>
                    <groupId>org.springframework.cloud</groupId>
                    <artifactId>spring-cloud-dependencies</artifactId>
                    <version>Finchley.RC1</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>
        </build>
    
        <repositories>
            <repository>
                <id>spring-milestones</id>
                <name>Spring Milestones</name>
                <url>https://repo.spring.io/milestone</url>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
        </repositories>
    
    </project>
    @EnableEurekaServer
    @SpringBootApplication
    public class CloudApplication {
    
        public static void main(String[] args) {
            SpringApplication.run(CloudApplication.class, args);
        }
    
    }
  • 相关阅读:
    Spring深入浅出(九),注解,@Autowired/@Resource,及其它(@Component/@Repository/@Service/@Controller)
    Spring深入浅出(八),自动装配,constructor
    使用node-webkit包装浏览器
    node-webkit 屏幕截图功能
    nodeJS 爬虫,通过Puppeteer实现滚动加载
    nodejs爬虫笔记(四)---利用nightmare解决加载更多问题
    一款开源免费的WPF图表控件ModernuiCharts
    使用各种 WPF Chart图表控件、插件的经历回顾与总结
    android 控件转bitmap
    一些关于 SAP Spartacus 组件和模块延迟加载的问题和解答
  • 原文地址:https://www.cnblogs.com/Leechg/p/10796759.html
Copyright © 2011-2022 走看看