Maven and Spring Boot - non resolvable parent pom - repo.spring.io (Unknown host)

197,846

Solution 1

Obviously it's a problem with your internet connection. Check, if you can reach http://repo.spring.io with your browser. If yes, check if you need to configure a proxy server. If no, you should contact your internet provider.

Here is the documentation, how you configure a proxy server for Maven: https://maven.apache.org/guides/mini/guide-proxies.html

Solution 2

For anyone stumbling upon this question, I'll post the solution to a similar problem (same error message except for the uknown host part).

Since January 15, 2020 maven central no longer supports HTTP, in favour of HTTPS. Consequently, spring repositories switched to HTTPS as well

The solution is therefore to change the urls from http://repo.spring.io/milestone to https://repo.spring.io/milestone.

Solution 3

The issue is with your project which is not able to complete maven build. Steps to follow :

  1. Right Click Application and RunAs maven install.
  2. If you get any error while reaching the repos online try giving the proxies in settings.xml under your .m2 directory.Check this link for setting proxies for maven build.
  3. Once done , try doing a Update Project by Right Click Project , Maven->Update Maven Project and select codebase and do check the Force Update of Snapshot/Release check box.

This will update your maven build and will surely remove your errors with pom.xml

Solution 4

Project->maven->Update Project->tick all checkboxes expect offline and error is solved soon.

Solution 5

Rigth button on your project -> Maven -> Update

Share:
197,846
Kingamere
Author by

Kingamere

Updated on February 20, 2022

Comments

  • Kingamere
    Kingamere about 2 years

    I am trying to build my project but I get this:

    Non-resolvable parent POM: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:1.3.0.M3 from/to spring-snapshots (http://repo.spring.io/snapshot): repo.spring.io and 'parent.relativePath' points at no local POM @ line 16, column 10: Unknown host repo.spring.io -> [Help 2]

    Here is how I specify the parent of my pom.xml:

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.3.0.M3</version>
        <relativePath></relativePath>
    </parent>
    

    The is empty so that it forces maven to look for the parent in the remote repository. However, it says that repo.spring.io is an unknown host.

    Here is how I define the repositories in my pom.xml:

    <repositories>
        <repository>
            <id>spring-snapshots</id>
            <url>http://repo.spring.io/snapshot</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>spring-milestones</id>
            <url>http://repo.spring.io/milestone</url>
        </repository>
    </repositories>
    
    <pluginRepositories>
        <pluginRepository>
            <id>spring-snapshots</id>
            <url>http://repo.spring.io/snapshot</url>
        </pluginRepository>
        <pluginRepository>
            <id>spring-milestones</id>
            <url>http://repo.spring.io/milestone</url>
        </pluginRepository>
    </pluginRepositories>
    

    Any ideas?

  • Kingamere
    Kingamere over 8 years
    I assumed I had internet connection from the RDP, but I checked and I don't. thanks
  • Janac Meena
    Janac Meena over 6 years
    In addition to this answer, I also had to add proxy information to my Intellij settings
  • Tulsi Jain
    Tulsi Jain over 6 years
    I was using company proxy network, hence the issue. When i tried from home network(outside company) it worked fine
  • Qasim
    Qasim almost 4 years
    How to change url from http to https or where to change it
  • Oliver Gebert
    Oliver Gebert almost 4 years
    From all that I see, the apache maven repo is not included in the repo list...
  • Oliver Gebert
    Oliver Gebert almost 4 years
    Your advice is to downgrade the version because of a protocol problem?
  • EugenSunic
    EugenSunic over 3 years
    please provide steps on how to change that
  • Aamir Rizwan
    Aamir Rizwan almost 3 years
    The repo requires HTTPS now: repo.spring.io