Reputation: 185
I'm trying to create a project New -> Spring Stater Project. then fill the facts then press the finish. After that in POM.xml file shows small red x mark when I open it red x mark at the tag.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
Error :
Project build error: Non-resolvable parent POM for com.dasun:HotelReservation: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): connect timed out and 'parent.relativePath' points at no local POM
How to solve this problem? Thanks.
Upvotes: 2
Views: 3002
Reputation: 26
For your problem, you can use spring initializr which will generate a basic project structure for you based on the build system you choose(Maven for your case).
All you need to do is select all the dependencies needed for your spring boot project and click on generate the project. After downloading, extract and import the project to your IDE.project downloaded will contain pom.xml with the dependencies you have selected and required configuration for the project. check out this link for spring initializer: https://start.spring.io/
select the build system (Maven or Gradle)
select Spring boot version
fill the fields Group ID and Artifact ID
Finally, select the dependencies for your project and click on Generate project.
Extract the ZIP file downloaded and import the project to your IDE.the project downloaded will have basic pom.xml with the dependencies you have selected and required configuration for the project.
Upvotes: 1
Reputation: 3109
Due to the <relativePath/>
-tag, maven attempts to read the parent pom from a relative path on your hard drive while no relative path is specified. Removing the tag should fix the problem:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.5.RELEASE</version>
</parent>
Maven will now download the parent pom from Maven Central.
Upvotes: 1