【问题标题】:Maven Spring boot and Spring Cloud pom dependency not found未找到 Maven Spring boot 和 Spring Cloud pom 依赖项
【发布时间】:2021-07-24 22:51:04
【问题描述】:

我发现这很难识别出突然 CI/CD 管道 中断,因为 Spring boot pom 在该位置不再可用。

当我运行命令 mvn clean install 时,我看到下面两个 pom 放错位置/不再可用,这在历史上已经工作了 3-4 年 -

第一个 -

Downloading: https://repo.spring.io/snapshot/org/springframework/boot/spring-boot-starter-parent/1.3.3.RELEASE/spring-boot-starter-parent-1.3.3.RELEASE.pom

Downloading: https://repo.spring.io/milestone/org/springframework/boot/spring-boot-starter-parent/1.3.3.RELEASE/spring-boot-starter-parent-1.3.3.RELEASE.pom

第二个-

Downloading: https://repo.spring.io/snapshot/org/springframework/cloud/spring-cloud-dependencies/Brixton.RELEASE/spring-cloud-dependencies-Brixton.RELEASE.pom

Downloading: https://repo.spring.io/milestone/org/springframework/cloud/spring-cloud-dependencies/Brixton.RELEASE/spring-cloud-dependencies-Brixton.RELEASE.pom

在 pom.xml 中我在下面提到了依赖项 -

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

    </dependencyManagement>

POM 提到了以下存储库 -

<repositories>
        <repository>
            <id>spring-snapshots</id>
            <name>Spring snapshots</name>
            <url>https://repo.spring.io/snapshot</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>spring-milestones</id>
            <name>Spring milestones</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>

        <repository>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>central</id>
            <name>bintray</name>
            <url>https://jcenter.bintray.com</url>
        </repository>
    </repositories>

知道这里发生了什么吗?希望大家谅解。

注意:该项目是在 Spring 1.3.3 版本发布时构建的,我们无法立即更改版本。

【问题讨论】:

    标签: spring-boot maven spring-boot-starter-parent


    【解决方案1】:

    您似乎缺少 RELEASE 存储库

    <repository>
        <id>spring-repo</id>
        <name>Spring Repository</name>
        <url>https://repo.spring.io/release</url>
        <snapshots>
           <enabled>false</enabled>
        </snapshots>
    </repository>
    

    根据 this 博客,应该使用 maven Central 来处理 Spring 依赖项。 https://repo.spring.io/release以后也可以屏蔽。

    <repository>
        <id>maven-central</id>
        <name>Maven Centrail</name>
        <url>https://repo1.maven.org/maven2</url>
        <snapshots>
           <enabled>false</enabled>
        </snapshots>
    </repository>
    

    【讨论】:

    • 太棒了,现在它开始获取 repos,不知道到目前为止它是如何工作的。您能否将此与春季回购的任何最新更改联系起来。或者,如果您能指导我找到正确的资源以了解快照/里程碑/发布回购,那就更好了......
    • 我认为影响是由于 bintray 的日落造成的。 status.bintray.com
    • 这个插件仓库的替代品是什么 - truecentral bintray-pluginsjcenter.bintray.com</url>
    • 试试repo1.maven.org/maven2 maven central 应该有所有的依赖
    • 我仍然面临一些问题。为它创建了另一个线程。有机会请看-stackoverflow.com/questions/67364271/…
    猜你喜欢
    • 2020-10-08
    • 2020-03-31
    • 2020-11-11
    • 2020-08-28
    • 1970-01-01
    • 1970-01-01
    • 2018-01-10
    • 1970-01-01
    • 2018-10-09
    相关资源
    最近更新 更多