java - Spring Cloud快速入门演示maven

标签 java maven spring-cloud

我想通过官方demo学习Spring Cloud。

https://projects.spring.io/spring-cloud/#quick-start

maven pom 看起来像这样:

<parent>
  <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.1.RELEASE</version>
</parent>
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>Finchley.RC2</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
<dependencies>
    <dependency>
        <groupId></groupId>
        <artifactId>spring-cloud-starter-config</artifactId>
    </dependency>
    <dependency>
        <groupId></groupId>
        <artifactId>spring-cloud-starter-eureka</artifactId>
    </dependency>
</dependencies><repositories>
    <repository>
        <id>spring-milestones</id>
        <name>Spring Milestones</name>
        <url>https://repo.spring.io/libs-milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>

我很困惑。 spring-cloud-starter-config 的 groupId 在哪里? 当我将其复制到 intellij 时,它说 xml 标签的主体为空。我如何运行演示?

最佳答案

您添加 groupId <groupId>org.springframework.cloud</groupId>

     <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>
   <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-eureka</artifactId>
        </dependency>

关于java - Spring Cloud快速入门演示maven,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50785313/

相关文章:

Spring Cloud 和 Eureka : java. lang.IllegalStateException:没有可用于 ACCOUNTS-SERVICE 的实例

java - Spring 启动 Jpa : hibernate as default?

java - 将 Int 值传递给另一个类

java - 如何在 Spring Boot 中获取 log4j2.properties 文件以从 pom.xml 读取文件名

Maven:在哪里存储示例源代码?

spring-cloud - Spring Cloud eureka 客户端到多个 eureka 服务器

java - 在 java 类中捕获错误

java - 如何在创建对象时自动在构造函数中分配变量

java - 在所有子模块中显式声明 maven-compiler-plugin

spring-cloud - Spring Cloud - hystrix-dashboard 不工作?