问题描述
我发现很难识别突然 CI/CD 管道损坏,因为 Spring boot pom 在该位置不再可用.
I find this difficult to identify all of sudden CI/CD pipeline broken due to the fact that Spring boot pom is not available anymore at the location.
当我运行命令 mvn clean install
时,我看到下面两个 pom 放错地方/不再可用,这在历史上已经工作了 3-4 年 -
When I ran the command mvn clean install
, I see below two pom are misplaced/not available anymore, which was historically working for 3-4 years till now -
第一个 -
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 中我提到了下面的依赖 -
In the pom.xml I have mentioned below dependency -
<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 提到了以下存储库 -
POM has mention of below repository -
<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>
知道这里发生了什么吗?希望大家谅解.
Any clue what is happening here ? Hope for the understanding.
注意:该项目是在 Spring 1.3.3 版本发布时构建的,我们无法立即更改版本.
Note: The project was built at the time Spring 1.3.3 version was released and we cannot change the version straight away.
推荐答案
似乎您缺少 RELEASE 存储库
Seems you are missing the RELEASE repo
<repository>
<id>spring-repo</id>
<name>Spring Repository</name>
<url>https://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
根据 this 博客,应该使用 Maven 中心来处理 Spring 依赖项.https://repo.spring.io/release
以后也可以屏蔽.
As per this blog, one should be using the maven central for Spring dependencies. https://repo.spring.io/release
can also be blocked in the future.
<repository>
<id>maven-central</id>
<name>Maven Centrail</name>
<url>https://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
这篇关于找不到 Maven Spring boot 和 Spring Cloud pom 依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!