Jenkins部署项目,maven下载依赖环节出现错误,卡几天了,求解

git已经正常从gitee上拉取到项目代码了
在maven获取依赖的时候出现以下错误。maven版本 3.9.0(不知道版本有没有关系)
1、配置的aliyun镜像好像有点问题,但是我window 本机也是这么配的没有问题。
2、'parent.relativePath' ,查博客好像说将

    <parent>
        <groupId>org.springframework.bootgroupId>
        <artifactId>spring-boot-starter-parentartifactId>
        <version>2.7.1version>
        <relativePath/>
    parent>

换成

    <parent>
        <groupId>org.springframework.bootgroupId>
        <artifactId>spring-boot-starter-parentartifactId>
        <version>2.7.1version>
        <relativePath>./<relativePath>
    parent>

或者直接删除了,但是没有用

Parsing POMs
ERROR: Failed to parse POMs
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[WARNING] 'parent.relativePath' of POM org.example:Wx-login:1.0-SNAPSHOT (/var/lib/jenkins/workspace/java-pro2/pom.xml) points at org.example:Wx-login instead of org.springframework.boot:spring-boot-starter-parent, please verify your project structure @ line 15, column 10
[FATAL] Non-resolvable parent POM for org.example:Wx-login:1.0-SNAPSHOT: org.springframework.boot:spring-boot-starter-parent:pom:2.7.1 failed to transfer from http://0.0.0.0/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of maven-default-http-blocker has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.7.1 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [alimaven (http://maven.aliyun.com/nexus/content/repositories/central/, default, releases)] and 'parent.relativePath' points at wrong local POM @ line 15, column 10

问题卡很久了,求解😥

回答不易 求求您采纳哦

您可以尝试以下几种方法来解决该问题:

  • 检查你的Maven配置是否正确,尤其是settings.xml文件是否正确配置了aliyun镜像。你可以尝试在本地手动执行"Maven clean install" 命令,以确保你的本地Maven可以正常工作。

  • 清空Maven本地仓库,方法是进入Maven本地仓库所在目录(默认为用户目录下的".m2"文件夹),删除其中的所有内容,然后重新执行"Maven clean install"命令。

如果你的项目是基于Spring Boot的,你可以尝试在pom.xml文件中删除节点,或者将其设置为相对路径的正确值。例如:

<parent>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-parent</artifactId>
   <version>2.7.1</version>
   <relativePath>../spring-boot-starter-parent-2.7.1.pom</relativePath>
</parent>


  • 如果以上方法仍然无法解决问题,您可以考虑更新Maven默认的http阻断器(maven-default-http-blocker)的更新间隔,方法是修改settings.xml文件中的"maven-default-http-blocker"配置节点,设置updateInterval为一个较小的值

如果不配镜像是可以下载包的,但是太慢了