Pons
Pons

Reputation: 1111

Spring Boot batch App - Maven error

I have created a Spring boot batch maven project using Spring Initializr. When i imported the downloaded zip as maven project on my STS, i faced the following problem,

Failure to transfer org.springframework.batch:spring-batch-infrastructure:jar:3.0.7.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.batch:spring-batch-infrastructure:jar:3.0.7.RELEASE from/to central (https://repo.maven.apache.org/maven2): The operation was cancelled.

Spring boot version - 1.5.2

Java - 1.8

After several hours of changes and attempts, the issue was reolved once i decided to delete the contents under my local maven repo 'C:\Local.m2\repository'. Basically i,

  1. Closed my STS
  2. Deleted all the contents of my local maven repo
  3. Open the STS
  4. Update the project (Maven -> Update Project)

Now my question is, can someone explain what has happened here? Is there a way to prevent these kind of issues. This had taken away lot of my time. Is there any way to create project using Spring Initializr without these issues?

Upvotes: 0

Views: 910

Answers (1)

Cleto Gadelha
Cleto Gadelha

Reputation: 1101

It's basically a problem with the download, you can't know for sure when it's going to happening.

Using the "delete approach", you don't need to remove ALL your maven repo, just the one that's facing the issue.

But the error message tell's that:

resolution will not be reattempted until the update interval of central has elapsed or updates are forced.

You don't want to wait, of course, so your can force the update running mvn clean install -U from command line, or using STS on Run as -> Maven build... and write clean install -U at goals field. -U means: force update!

Upvotes: 1

Related Questions