Skip to content
Advertisement

Could not transfer artifacts from/to central maven repo when using Spring Framework Cloud

I am trying to create a maven project using Spring Framework Cloud. I defined pom.xml file as below

JavaScript

When trying to build maven getting error for all dependencies as

Could not transfer artifacts from/to central (https://repo.maven.apache.org/maven2)

Multiple annotations found at this line: – Failure to transfer org.springframework:spring-orm:jar:4.2.6.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:spring-orm:jar:4.2.6.RELEASE from/to central
(https://repo.maven.apache.org/maven2): The operation was cancelled. org.eclipse.aether.transfer.ArtifactTransferException: Failure to transfer org.springframework:spring-orm:jar: 4.2.6.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:spring-orm:jar:4.2.6.RELEASE from/to central (https://repo.maven.apache.org/maven2): The operation was cancelled. at
org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:238) at
org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:206) at
org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:585) at
org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:503) at
org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421) at
org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246) at
org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:367) at

When I go to the location, I can clearly see the Jar files are present in that location. Is there something else I need to add to my pom.xml?

Advertisement

Answer

I tried the same pom.xml inEclipse IDE and surprisingly it worked there as it is.

To make it work on STS, I added following properties

JavaScript

Refer Unable to download/import package org.springframework.cloud.config.server.EnableConfigServer

This worked for me, though I am still curious about the difference.

Advertisement