Cannot resolve org.springframework.cloud:spring-cloud-starter-netflix-eureka-client:unknown

huangapple go评论63阅读模式
英文:

Cannot resolve org.springframework.cloud:spring-cloud-starter-netflix-eureka-client:unknown

问题

以下是已翻译的内容:

我正在跟随一个教程学习使用 Spring Boot 创建 Eureka 服务器/客户端。当我尝试在 pom.xml 中安装 Maven 依赖时,我遇到了标题中的错误。

这是我的 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.3.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.nlimits</groupId>
    <artifactId>movie_info_service</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>movie_info_service</name>
    <description>Movie Info Service</description>

    <properties>
        <java.version>11</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

我该如何解决这个问题,为什么会出现这种情况?

英文:

I am following a tutorial to learn eureka server/client with spring boot
when I try to install maven dependencies in the pom.xml I get the error in the title

this is my pom.xml file:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
         xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;parent&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
        &lt;version&gt;2.3.3.RELEASE&lt;/version&gt;
        &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
    &lt;/parent&gt;
    &lt;groupId&gt;com.nlimits&lt;/groupId&gt;
    &lt;artifactId&gt;movie_info_service&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;name&gt;movie_info_service&lt;/name&gt;
    &lt;description&gt;Movie Info Service&lt;/description&gt;

    &lt;properties&gt;
        &lt;java.version&gt;11&lt;/java.version&gt;
    &lt;/properties&gt;

    &lt;dependencies&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
            &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
            &lt;artifactId&gt;spring-cloud-starter-netflix-eureka-client&lt;/artifactId&gt;
        &lt;/dependency&gt;

        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
            &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
            &lt;scope&gt;test&lt;/scope&gt;
            &lt;exclusions&gt;
                &lt;exclusion&gt;
                    &lt;groupId&gt;org.junit.vintage&lt;/groupId&gt;
                    &lt;artifactId&gt;junit-vintage-engine&lt;/artifactId&gt;
                &lt;/exclusion&gt;
            &lt;/exclusions&gt;
        &lt;/dependency&gt;
    &lt;/dependencies&gt;

    &lt;build&gt;
        &lt;plugins&gt;
            &lt;plugin&gt;
                &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
            &lt;/plugin&gt;
        &lt;/plugins&gt;
    &lt;/build&gt;

&lt;/project&gt;

How can I solve this problem and why is it happening?

答案1

得分: 12

我也在跟着教程进行学习。

我使用了 Spring Boot 在 IntelliJ 2020.1 中创建了一个基本的微服务。

我向我的项目中添加了 spring-cloud-starter-netflix-eureka-client starter。

以下是添加到 pom.xml 的内容:

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

 <dependency>
  <groupId>org.springframework.cloud</groupId>
  <artifactId>spring-cloud-dependencies</artifactId>
  <version>Hoxton.SR8</version>
  <type>pom</type>
  <scope>import</scope>
</dependency>

重新加载 Maven 的 pom.xml 文件后,我收到了依赖项未找到的错误。

以下是错误信息:

无法解析 org.springframework.cloud:spring-cloud-starter-netflix-eureka-client:unknown

我正在使用 Spring Boot 2.3.5。

<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.5.RELEASE</version>

解决方法:

出于某种原因,当使用 spring initializr 添加 spring-boot-starter 时,eureka discovery client 的版本没有自动添加到 pom 中。所以我手动添加了版本:

<version>2.2.5.RELEASE</version>
<dependency>
  <groupId>org.springframework.cloud</groupId>
  <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
  <version>2.2.5.RELEASE</version>
</dependency>

然后在刷新 Maven 的 pom.xml 后,依赖项得到了识别。

英文:

I too am following a tutorial as well.

I created a basic microservice using Spring Boot in IntelliJ 2020.1

I added the spring-cloud-starter-netflix-eureka-client starter to my project.

Here is what was added to the pom.xml:

&lt;dependency&gt;
  &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
  &lt;artifactId&gt;spring-cloud-starter-netflix-eureka-client&lt;/artifactId&gt;
&lt;/dependency&gt;

 &lt;dependency&gt;
  &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
  &lt;artifactId&gt;spring-cloud-dependencies&lt;/artifactId&gt;
  &lt;version&gt;Hoxton.SR8&lt;/version&gt;
  &lt;type&gt;pom&lt;/type&gt;
  &lt;scope&gt;import&lt;/scope&gt;
&lt;/dependency&gt;

After reloading the maven pom.xml file, I get the error that dependency is not found.

Here is the error:

> Cannot resolve org.springframework.cloud:spring-cloud-starter-netflix-eureka-client:unknown

I am using Spring Boot 2.3.5.

&lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
&lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
&lt;version&gt;2.3.5.RELEASE&lt;/version&gt;

SOLUTION :

For some reason, the version of the eureka discovery client is not added automatically to the pom when using the spring initializr to add the spring-boot-starter. So I added the version manually:

&lt;version&gt;2.2.5.RELEASE&lt;/version&gt;
&lt;dependency&gt;
  &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
  &lt;artifactId&gt;spring-cloud-starter-netflix-eureka-client&lt;/artifactId&gt;
  &lt;version&gt;2.2.5.RELEASE&lt;/version&gt;
&lt;/dependency&gt;

Then after refreshing the maven pom.xml the dependency was recognized.

答案2

得分: 10

<dependencies/> 部分之后、<build/> 部分之前,添加如下代码:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-parent</artifactId>
            <version>Greenwich.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
英文:

just add this code after &lt;dependencies/&gt; section and before &lt;build/&gt; section:

&lt;dependencyManagement&gt;
    &lt;dependencies&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
            &lt;artifactId&gt;spring-cloud-starter-parent&lt;/artifactId&gt;
            &lt;version&gt;Greenwich.RELEASE&lt;/version&gt;
            &lt;type&gt;pom&lt;/type&gt;
            &lt;scope&gt;import&lt;/scope&gt;
        &lt;/dependency&gt;
    &lt;/dependencies&gt;
&lt;/dependencyManagement&gt;

答案3

得分: 3

检查Spring Boot Starter版本(2.3.3)和Spring Cloud版本(2.2.5),它会导致构建失败,我建议使用Spring Initializer为您的项目创建pom/build文件。

英文:

Check the Spring boot Starter version (2.3.3) and Spring Cloud version (2.2.5), it fails your build, I recommend to use Spring Initializer to create your pom/build file for your project.

答案4

得分: 3

我通过在属性中添加Spring Cloud版本来成功解决了这个问题。

<properties>
    <java.version>11</java.version>
    <spring-cloud.version>Hoxton.SR8</spring-cloud.version>
</properties>
英文:

I managed to solve this problem by adding spring cloud version in properties.

&lt;properties&gt;
    &lt;java.version&gt;11&lt;/java.version&gt;
    &lt;spring-cloud.version&gt;Hoxton.SR8&lt;/spring-cloud.version&gt;
&lt;/properties&gt;

答案5

得分: 2

修改pom.xml中的Spring Boot版本(以及Spring Cloud版本)

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.5.RELEASE</version>
        <relativePath/> 
    </parent>

    <properties>
        <java.version>11</java.version>
        <spring-cloud.version>Greenwich.SR1</spring-cloud.version>
    </properties>
英文:

Change the spring boot version (and the spring cloud version) in the pom.xml

&lt;parent&gt;
	&lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
	&lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
	&lt;version&gt;2.1.5.RELEASE&lt;/version&gt;
	&lt;relativePath/&gt; 
&lt;/parent&gt;

&lt;properties&gt;
	&lt;java.version&gt;11&lt;/java.version&gt;
	&lt;spring-cloud.version&gt;Greenwich.SR1&lt;/spring-cloud.version&gt;
&lt;/properties&gt;

答案6

得分: 1

我意识到 jar 文件被下载到项目文件夹中的 "Maven Dependencies" 文件夹,但 POM 错误仍然存在。

解决方案:
删除 C:\Users<user>.m2 文件夹,然后从 POM 重新加载 Maven。

英文:

I realized the jar files are downloaded into "Maven Dependencies" in the project folder but the POM error still exist.

Solution:-
Delete the C:\Users&lt;user>.m2 folder and then reload maven from POM.

答案7

得分: 0

手动添加Eureka发现客户端的版本可以帮助解决这个问题。
我添加了版本,然后它起作用了。

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
    <version>2.2.10.RELEASE</version>
</dependency>
英文:

Adding the version of eureka discovery client manually can help to resolve the problem.
I added the version and it worked.

&lt;dependency&gt;
    &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
    &lt;artifactId&gt;spring-cloud-starter-netflix-eureka-client&lt;/artifactId&gt;
    &lt;version&gt;2.2.10.RELEASE&lt;/version&gt;
&lt;/dependency&gt;

答案8

得分: 0

请参考以下示例。在您的 pom.xml 中添加了一些您没有的内容,请忽略注释;完成后,请检查您的类型,这是区分大小写的。我的示例使用服务器。希望能解决相关问题。

    <properties>
        <!-- 使用 Java 17 -->
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <!-- 可选的(?) -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <!-- 这里的主要问题(?) -->
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
        </dependency>
    </dependencies>

信息:

文件|项目结构 -> 项目 -> SDK: SDK corretto-17

在处理过程中检查您代码示例的颜色:

//todo: 它会变成红色.. 必须有不同的颜色
@EnableEurekaServer

它应该是 红色 的。如果红色没问题.. 不要添加这行代码

//todo: 通过导入添加
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;

您必须重新加载 Maven(这需要一些时间.. 对我来说需要 2 分钟)以便下载所需内容。然后将光标放在红色代码上,直到弹出式窗口显示

无法解析符号 Bla bla

然后点击 导入类
结果应该如下所示

package com.***.eurekaserver;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
//todo: 通过导入添加
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
//todo: 添加应用程序和服务器
@SpringBootApplication
@EnableEurekaServer
//仅为示例名称
public class EurekaServerApplication {
    //todo: 创建 main 方法
}

如果没有任何反应,您应该遵循一些建议

  1. 降低您的脚本版本。不是好主意
  2. 降低您的 Java 版本。仍然不是好主意,我正在使用 17,而此时的新 Java 版本是 19。
  3. 检查您代码中的版本。当我创建这个时,示例中的 <artifactid> 下方有一个版本,我的工作代码中未使用此行。pom.xml(父级)中的版本为

<spring.cloud-version>2020.0.3</spring.cloud-version>

如果您发现当前版本不起作用,请为其添加注释。

免责声明:使用 Intellij Idea。

来源:YouTube

关键词 #servicediscovery #microservices #amigoscode

为了比较,我发布了根 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.***code</groupId>
  <artifactId>***services</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>pom</packaging>

  <name>***services</name>
  <url>http://www.***services.com</url>

  <modules>
<!--这里有一些不想分享的内容-->
    <module>eureka-server</module>
  </modules>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
    <spring.boot.maven.plugin.version>2.5.7</spring.boot.maven.plugin.version>
    <spring.boot.dependency.version>2.5.7</spring.boot.dependency.version>
    <spring.cloud-version>2020.0.3</spring.cloud-version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${spring.boot.dependency.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-dependencies</artifactId>
        <version>${spring.cloud-version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
          <version>${spring.boot.maven.plugin.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>
英文:

Follow below example. Added something you not have on your pom.xml please ignore the comment; when you are done, please check your type, this is case sensitive. My example using server. Hope work on related issue

    &lt;properties&gt;
&lt;!-- using java 17 --&gt;
&lt;maven.compiler.source&gt;17&lt;/maven.compiler.source&gt;
&lt;maven.compiler.target&gt;17&lt;/maven.compiler.target&gt;
&lt;!--optional(?)--&gt;
&lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
&lt;/properties&gt;
&lt;!-- the main problem here(?)--&gt;
&lt;dependencies&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
&lt;artifactId&gt;spring-cloud-starter-netflix-eureka-server&lt;/artifactId&gt;
&lt;/dependency&gt;
&lt;/dependencies&gt;

info:
> file|Project Structure -> project -> SDK: SDK corretto-17


during process check the color of your code example:

//todo: it goes red.. must have different color 
@EnableEurekaServer

It supposed to be red. If red is fine.. don't added this line

//todo: added by importing
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;

you must reload the maven (it take times.. for me take 2 minutes) in order to download what you needed. Then put your cursor on the red code until pop-up

> cannot resolve symbol Bla bla

then click import the class.
Result you should have

package com.***.eurekaserver;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
//todo: added by importing 
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
//todo added application and server
@SpringBootApplication
@EnableEurekaServer
//just example name
public class EurekaServerApplication {
//todo: make main
}

If nothing happen, then you should follow some suggestion

  1. downgrade your script. Were Bad idea
  2. downgrade your java. Still bad idea, I'm using 17, while new java version on this moment are 19.
  3. check the version on your code. When I make this, there is version below the <artifactid> on the example and my working code, the line not used it. the version said on the pom.xml (parent) were

> <spring.cloud-version>2020.0.3</spring.cloud-version>

If you find the current version not worked. Please added comment for it.

disclamer: using Intellij Idea.

source: youtube
> with keyword #servicediscovery #microservices #amigoscode

For compare purpose I'm posting root pom.xml for refences only

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
&lt;groupId&gt;com.***code&lt;/groupId&gt;
&lt;artifactId&gt;***services&lt;/artifactId&gt;
&lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
&lt;packaging&gt;pom&lt;/packaging&gt;
&lt;name&gt;***services&lt;/name&gt;
&lt;url&gt;http://www.***services.com&lt;/url&gt;
&lt;modules&gt;
&lt;!--something here not wanted to share--&gt;
&lt;module&gt;eureka-server&lt;/module&gt;
&lt;/modules&gt;
&lt;properties&gt;
&lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
&lt;maven.compiler.source&gt;17&lt;/maven.compiler.source&gt;
&lt;maven.compiler.target&gt;17&lt;/maven.compiler.target&gt;
&lt;spring.boot.maven.plugin.version&gt;2.5.7&lt;/spring.boot.maven.plugin.version&gt;
&lt;spring.boot.dependency.version  &gt;2.5.7&lt;/spring.boot.dependency.version&gt;
&lt;spring.cloud-version&gt;2020.0.3&lt;/spring.cloud-version&gt;
&lt;/properties&gt;
&lt;dependencyManagement&gt;
&lt;dependencies&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
&lt;artifactId&gt;spring-boot-dependencies&lt;/artifactId&gt;
&lt;version&gt;${spring.boot.dependency.version}&lt;/version&gt;
&lt;scope&gt;import&lt;/scope&gt;
&lt;type&gt;pom&lt;/type&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
&lt;artifactId&gt;spring-cloud-dependencies&lt;/artifactId&gt;
&lt;version&gt;${spring.cloud-version}&lt;/version&gt;
&lt;type&gt;pom&lt;/type&gt;
&lt;scope&gt;import&lt;/scope&gt;
&lt;/dependency&gt;
&lt;/dependencies&gt;
&lt;/dependencyManagement&gt;
&lt;dependencies&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.projectlombok&lt;/groupId&gt;
&lt;artifactId&gt;lombok&lt;/artifactId&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
&lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
&lt;/dependency&gt;
&lt;/dependencies&gt;
&lt;build&gt;
&lt;pluginManagement&gt;
&lt;plugins&gt;
&lt;plugin&gt;
&lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
&lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
&lt;version&gt;${spring.boot.maven.plugin.version}&lt;/version&gt;
&lt;/plugin&gt;
&lt;/plugins&gt;
&lt;/pluginManagement&gt;
&lt;/build&gt;
&lt;/project&gt;

答案9

得分: 0

我尝试在依赖项下面添加了dependencyManagement,它起作用了

<dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
英文:

I tried adding dependencyManagement under dependencies it worked

&lt;dependencyManagement&gt;
&lt;dependencies&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
&lt;artifactId&gt;spring-cloud-dependencies&lt;/artifactId&gt;
&lt;version&gt;${spring-cloud.version}&lt;/version&gt;
&lt;type&gt;pom&lt;/type&gt;
&lt;scope&gt;import&lt;/scope&gt;
&lt;/dependency&gt;
&lt;/dependencies&gt;
&lt;/dependencyManagement&gt;

答案10

得分: -1

在 Spring 启动时,创建项目时,还要考虑这些存储库,它们非常基础。

    <repositories>
          // 数据
    </repositories>
    <pluginRepositories>
        <pluginRepository>
          // 数据
        </pluginRepository>
        <pluginRepository>
          // 数据
        </pluginRepository>
    </pluginRepositories>
英文:

At Spring Start, when creating the project,
also take the repositories, these guys are fundamental.

&lt;repositories&gt;
// DATA
&lt;/repositories&gt;
&lt;pluginRepositories&gt;
&lt;pluginRepository&gt;
// DATA
&lt;/pluginRepository&gt;
&lt;pluginRepository&gt;
// DATA
&lt;/pluginRepository&gt;
&lt;/pluginRepositories&gt;

huangapple
  • 本文由 发表于 2020年9月2日 02:36:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/63693570.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定