Reputation: 11
I'm trying to create a default spring boot app in STS. It was creating a "spring starter project" in STS file--> . No changes were made after the project was created. The error was shown in the POM file immediately...
It fails with the following error. What does it take to resolve this problem when everything is default?
Project build error: Non-resolvable parent POM for com.example:hello-boot:0.0.1-SNAPSHOT: Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:2.0.5.RELEASE from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.0.5.RELEASE from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org and 'parent.relativePath' points at no local POM
The pom file is as follows: http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0
<groupId>com.example</groupId>
<artifactId>first-boot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>first-boot</name>
<description>Hello Spring Boot in STS</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.5.RELEASE</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>
Upvotes: 1
Views: 3152
Reputation: 11
Thanks Aagam Jain and veben. I tried out the steps and it did not work. The reason was the missing proxy server settings.
Once I added the proxy settings to the XML, the app was build and run successfully. It was run with the combination of your steps and proxy server settings.
Appreciate the help..
Upvotes: 0
Reputation: 1334
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. In most cases, we need to configure the proxy server.
I will help you with the steps to set up the proxy in STS or eclipse:
Download the Apache Maven 3.5.4 tool from here.
Assuming that you downloaded the zip file, now go unzip it.
After unzipping, navigate inside: ./Apache-maven-3.3.9/conf
. Now inside conf
folder open the setting.xml
with any text editor.
Now in settings.xml
file, look for the proxies tag and replace it with this.
<proxies>
<proxy>
<id>example-proxy</id>
<active>true</active>
<protocol>http</protocol>
<host>proxy.example.com</host>
<port>8080</port>
<username>proxyuser</username>
<password>somepassword</password>
<nonProxyHosts>www.google.com|*.example.com</nonProxyHosts>
</proxy>
</proxies>
Please change the <host>
, <port>
, <username>
and <password>
with your proxy settings.
Now open Eclipse. Go to Window
-> Preference
-> maven
-> User Settings
. Now in user settings
input box give the path to your settings.xml file and then click on Apply
and then Ok
. [screenshot for reference]
.
force update of snapshot/release
and click ok
. Here is the documentation, how you configure a proxy server for Maven: https://maven.apache.org/guides/mini/guide-proxies.html
Upvotes: 2
Reputation: 22332
First : Right click on your project folder > Maven > Update Project > OK
Then : Right click on your project folder > Run As > Maven build...
Upvotes: 1
Reputation: 1546
press Alt+F5 and select your project from list and then select check box "force update of snapshot/release" and click ok.
Now right click on project and select run as -> maven build.
Upvotes: 2