0

I donwloaded a new spring boot application (version 2.0.0) from https://start.spring.io/ and I tried to build it using netbeans IDE.

During the maven build I got the following error :

The build could not read 1 project -> [Help 1]

  The project com.deepit.springboot.example:spring-boot-in-deep:0.0.1-SNAPSHOT (~=NetBeansProjects\spring-boot-in-deep\pom.xml) has 1 error
    Non-resolvable parent POM: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.0.0.BUILD-SNAPSHOT from/to spring-snapshots (https://repo.spring.io/snapshot): repo.spring.io and 'parent.relativePath' points at no local POM @ line 14, column 10: Unknown host repo.spring.io -> [Help 2]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

Do you have an idea about the cause of this error ?

Aguid
  • 943
  • 2
  • 10
  • 24
  • You should check [this out](https://stackoverflow.com/questions/32125025/maven-and-spring-boot-non-resolvable-parent-pom-repo-spring-io-unknown-host) as an answer to your question. – AlexM Oct 26 '17 at 12:54
  • @AlexM the link is reachable and I also checked the proxy in my netbeans IDE and all works ! I am trying to configure the proxy of maven – Aguid Oct 26 '17 at 12:58

3 Answers3

0

@Ayadi Akrem

Can you post the contents of your POM?

Update: POM looks ok. I would guess a connection error (even though you said you tested it).

AlexM
  • 334
  • 2
  • 4
  • 16
0

http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0

<groupId>com.deepit.springboot.example</groupId>
<artifactId>spring-boot-in-deep</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>spring-boot-in-deep</name>
<description>Demo project for Spring Boot</description>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.0.BUILD-SNAPSHOT</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

<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>
</repositories>

<pluginRepositories>
    <pluginRepository>
        <id>spring-snapshots</id>
        <name>Spring Snapshots</name>
        <url>https://repo.spring.io/snapshot</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </pluginRepository>
    <pluginRepository>
        <id>spring-milestones</id>
        <name>Spring Milestones</name>
        <url>https://repo.spring.io/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </pluginRepository>
</pluginRepositories>

Aguid
  • 943
  • 2
  • 10
  • 24
0

To resolve this I add a proxy in the settings.xml file in the config folder of maven. To know the location of your settings file, start maven with -X option (debug) and examine the beginning of the output.

Aguid
  • 943
  • 2
  • 10
  • 24