0

我发现这很难识别所有突然中断的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 版本发布时构建的,我们无法立即更改版本。

4

1 回答 1

0

似乎您缺少 RELEASE 回购

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

根据这篇博客,应该使用 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>
于 2021-05-02T06:17:29.293 回答