4

I'm new to maven. I'm getting the following error, which I don't understand. Can you please help me to understand how to fix it ?

The following artifacts could not be resolved: org.springframework:org.springframework.core:jar:3.0.5.RELEASE, org.springframework:org.springframework.asm:jar:3.0.5.RELEASE: Failure to find org.springframework:org.springframework.core:jar:3.0.5.RELEASE in http://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 -> [Help 1]

shkra19
  • 309
  • 2
  • 4
  • 13

3 Answers3

1

Try running your command with the -U option. Here is more information.

Kevin Bowersox
  • 93,289
  • 19
  • 159
  • 189
  • If I do that I get the error I had in the first place: The following artifacts could not be resolved: org.springframework:org.springframework.core:jar:3.0.5.RELEASE, org.springframework:org.springframework.asm:jar:3.0.5.RELEASE: Could not find artifact org.springframework:org.springframework.core:jar:3.0.5.RELEASE in central (http://repo.maven.apache.org/maven2) -> [Help 1] – shkra19 Dec 01 '12 at 23:49
  • hmm, checkout this post: http://stackoverflow.com/questions/4856307/when-maven-says-resolution-will-not-be-reattempted-until-the-update-interval-of – Kevin Bowersox Dec 01 '12 at 23:51
  • In other words, my main problem is not that the update interval has not elapsed, but rather that this artifact can not be found. Yet it is required for my project. Does spring 3 not exist on repo.maven.apache.org ? – shkra19 Dec 01 '12 at 23:54
  • @KevinBowersox Wow! It's a miracle =) – naXa stands with Ukraine Apr 29 '17 at 10:18
  • @KevinBowersox BTW I've resolved that problem with dependency. But in my case the root was in *wrong* import statements that were specified in Getting Started page of DbUnit. – naXa stands with Ukraine Apr 29 '17 at 10:21
1

It would be more helpful if you provide your pom file with the question, but judging from a stacktrace it seems that dependency is not declared correctly. Specifically, correct artifact name for Spring is "spring-core" and not "org.springframework.core", So in your pom.xml file you should have:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>3.0.5.RELEASE</version>
</dependency>

You can find a correct dependency definition at public Maven Repo search engines (like http://mvnrepository.com or http://search.maven.org). Here is the the link to Spring Core artifact: http://mvnrepository.com/artifact/org.springframework/spring-core/3.0.5.RELEASE

Btw, the error that you see is in following format:

<groupId>:<artifactId>:<packaging>:<version>
Constantine
  • 424
  • 4
  • 6
  • Yes, you're right, thank you very much. But the artifact id that I was using did work on another computer, which had nexus. How is that possible ? Does nexus change the artifact id ? – shkra19 Dec 02 '12 at 11:39
  • Most likely the Nexus that you have used before was setup to proxy Spring's Maven repository from here: http://ebr.springsource.com/repository/app/bundle/version/detail?name=org.springframework.core&version=3.0.5.RELEASE It also possible that someone manually uploaded artifacts to Nexus with this artifactId. – Constantine Dec 03 '12 at 03:23
0

Yeah looks like your pom dependancy aren't marked correctly. Googling sample Spring MVC app and lookin sample pom will be helpful.

Leo Prince
  • 940
  • 2
  • 14
  • 33