IDEA 从GitHub上拉取的项目POM.xml 不能添加依赖 ,报错:Non-resolvable parent POM for com.cdc:blinddate:0.0.1-SNAPSHOT:

阳昊
2023-12-01

错误重现:

[ERROR]     Non-resolvable parent POM for com.fifree:backgroundFitfree:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:1.5.6.RELEASE from/to nexus-aliyun (http://maven.aliyun.com/nexus/content/groups/public): Connection reset by peer: socket write error and 'parent.relativePath' points at no local POM @ line 14, column 10 -> [Help 2]

原因:maven的settings文件不能从连网下载依赖jar包

解决方法:修改settings文件内容如下,其中需要修改里面的本地仓库地址

<?xml version="1.0" encoding="UTF-8"?>

<settings>
	<!-- 修改为自己的本地仓库 -->
    <localRepository>D:\itcast\aclass2tc\20170422\apache-maven-3.3.9\repository</localRepository>
    <interactiveMode>true</interactiveMode>
    <offline>false</offline>
    <mirrors>
        <mirror> 
              <id>repo2</id> 
              <mirrorOf>central</mirrorOf> 
              <name>spring2.0 for this Mirror.</name> 
              <url>https://repo.spring.io/libs-milestone</url> 
        </mirror> 
        <mirror> 
          <id>net-cn</id> 
          <mirrorOf>central</mirrorOf> 
          <name>Human Readable Name for this Mirror.</name> 
          <url>http://maven.net.cn/content/groups/public/</url>  
        </mirror> 
        <mirror> 
              <id>ui</id> 
     
          <mirrorOf>central</mirrorOf> 
              <name>Human Readable Name for this Mirror.</name> 
             <url>http://uk.maven.org/maven2/</url> 
        </mirror> 
        <mirror> 
          <id>ibiblio</id> 
          <mirrorOf>central</mirrorOf> 
          <name>Human Readable Name for this Mirror.</name> 
         <url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url> 
        </mirror> 
        <mirror> 
              <id>jboss-public-repository-group</id> 
              <mirrorOf>central</mirrorOf> 
              <name>JBoss Public Repository Group</name> 
             <url>http://repository.jboss.org/nexus/content/groups/public</url> 
        </mirror>
    </mirrors>
    <profiles>
        <profile>
            <id>neo</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <jdk>1.8</jdk>
            </activation>
            <repositories>
                    <repository>
                        <id>spring-milestones</id>
                        <name>Spring Milestones</name>
                        <url>https://repo.spring.io/libs-milestone</url>
                        <snapshots>
                            <enabled>false</enabled>
                        </snapshots>
                    </repository>
            </repositories>
        </profile>
    </profiles>
    <activeProfiles>
        <activeProfile>neo</activeProfile>     
    </activeProfiles>
</settings>

 

 类似资料: