0
votes

I created the project from Spring Initializr: https://start.spring.io/.

After importing it as a maven project in eclipse it's showing error in the pom.xml file that:

Description Resource Path Location Type Failure to transfer org.apache.maven.shared:file-management:pom:3.0.0 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.apache.maven.shared:file-management:pom:3.0.0 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org pom.xml /SpringApp line 1 Maven Configuration Problem

Error marked only the first line of code.

My pom.xml :

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.5.RELEASE</version>
</parent>
<groupId>com.example</groupId>
<artifactId>SpringApp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>SpringApp</name>
<description>Demo project for Spring Boot</description>

<properties>
    <java.version>1.8</java.version>
</properties>

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

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <scope>runtime</scope>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <scope>runtime</scope>
    </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>

</project>
1
Can you build it outside of Eclipse on a command line?Simon Martinelli
This is a network error: ` Could not transfer artifact org.apache.maven.shared:file-management:pom:3.0.0 from/to central (repo.maven.apache.org/maven2)`... firewall/proxy etc. ....khmarbaise

1 Answers

0
votes

This is due to corrupted/failed downloads which are causing the problem to update your maven project.

If you are a windows user please run this command in CMD

cd %userprofile%\.m2\repository
for /r %i in (*.lastUpdated) do del %i

this will delete all the failed downloads from the local repository. after this completes you can update dependencies of your project by Right-click on the project->Maven->Update Project->check the checkbox "Force Update of Snapshots/Releases" and click OK.