Maven build error No versions available for org.codehaus.jackson:jackson-core-asl:jar:[1.8,1.9) within specified range
Asked Answered
C

4

12

I am getting following error since today morning while doing maven build. There are no specific changes for yesterday and today. Can someone help me to resolve this? I tried clearing all local repositories, changing jackson version to 1.9.10. Surprisingly this is working for my colleagues who are working on same build.

[ERROR] Failed to execute goal on project netvogue-database-api: Could not resolve     dependencies for project org.netvogue.server:netvogue-database-api:jar:1.0-SNAPSHOT: Failed to collect dependencies for [org.springframework.data:spring-data-neo4j-rest:jar:2.1.0.RC4 (compile), org.codehaus.jackson:jackson-jaxrs:jar:1.8.3 (compile), org.codehaus.jackson:jackson-mapper-asl:jar:1.8.3 (compile), org.neo4j:neo4j-kernel:jar:tests:1.8.RC1 (test), org.neo4j:neo4j-cypher:jar:1.8.RC1 (compile), com.amazonaws:aws-java-sdk:jar:1.3.10 (compile), org.imgscalr:imgscalr-lib:jar:4.2 (compile), org.springframework:spring-context:jar:3.1.2.RELEASE (compile), org.springframework.security:spring-security-config:jar:3.1.2.RELEASE (compile), org.springframework.security:spring-security-web:jar:3.1.2.RELEASE (compile), org.slf4j:slf4j-api:jar:1.5.10 (compile), org.slf4j:jcl-over-slf4j:jar:1.5.10 (runtime), org.slf4j:slf4j-log4j12:jar:1.5.10 (runtime), log4j:log4j:jar:1.2.16 (compile), junit:junit:jar:4.7 (test)]: No versions available for org.codehaus.jackson:jackson-core-asl:jar:[1.8,1.9) within specified range -> [Help 1]
Congruity answered 29/9, 2012 at 10:31 Comment(0)
R
6

As pointed by yegor256, whoever is having this problem recently, it is probably caused by Amazon AWS. Just change your aws-java-sdk to a newer version (current is 1.3.20) and the problem will go away.

Ringster answered 1/10, 2012 at 14:29 Comment(3)
same here, changed the version to 1.3.20 and the build is back to normalWeltpolitik
Yes, when i changed it to latest version. problem went away.Congruity
how do I change the version of AWS ...??Rolo
F
12

It would appear that Jackson's jackson-core-asl maven-metadata.xml file has been corrupted.

When Maven attempts to resolve dependency versions from a range, it must look to the maven-metadata.xml file in order to determine the version candidates it can choose from. Currently that file looks like:

<metadata modelVersion="1.1.0">
  <groupId>org.codehaus.jackson</groupId>
  <artifactId>jackson-core-asl</artifactId>
  <versioning>
    <latest>1.1.0</latest>
    <release>1.1.0</release>
    <versions>
      <version>1.1.0</version>
    </versions>
    <lastUpdated>20120928142709</lastUpdated>
  </versioning>
</metadata>

This indicates that the only legal version a version range might choose from is 1.1.0. As an example of what this file most likely looked like before check the jackson-core-lgpl maven-metadata.xml file:

<metadata>
<groupId>org.codehaus.jackson</groupId>
  <artifactId>jackson-core-lgpl</artifactId>
  <version>0.9.8</version>
  <versioning>
    <versions>
      <version>0.9.8</version>
      <version>0.9.7</version>
      <version>0.9.9</version>
      <version>0.9.9-2</version>
      <version>0.9.9-3</version>
      <version>0.9.9-4</version>
      <version>0.9.9-5</version>
      <version>0.9.9-6</version>
      <version>1.0.0</version>
...

As was previously suggested, you can hard code a dependency on a specific version of Jackson which short-circuits the version resolution and avoids reading the maven-metadata.xml file.

Fennelly answered 1/10, 2012 at 7:52 Comment(4)
I've opened JACKSON-871 to track the issue.Fennelly
FWIW, I have found too many issue with Maven version ranges, that nowadays I always specify exact patch version. This is unfortunate -- since in many cases "latest patch" would work correctly -- but maven release plug-in and other components just have not let this work for me.Biologist
Issue was to due to the version ranges in my amazon pom file. When i changed my amazon sdk to latest, its working fine now.Congruity
Just to let everyone know, JACKSON-871 has been fixedFennelly
R
6

As pointed by yegor256, whoever is having this problem recently, it is probably caused by Amazon AWS. Just change your aws-java-sdk to a newer version (current is 1.3.20) and the problem will go away.

Ringster answered 1/10, 2012 at 14:29 Comment(3)
same here, changed the version to 1.3.20 and the build is back to normalWeltpolitik
Yes, when i changed it to latest version. problem went away.Congruity
how do I change the version of AWS ...??Rolo
M
2

I should point out that the latest version of this file (maven-metadata.xml) must be wrong. The latest version for org.codehaus.jackson/jackson-core-asl is 1.9.9.

Other dependencies that required other versions of jackson-core-asl, newer that 1.1.0, will break. As it did on my scenario. I had to manually change the maven-metadata.xml file ok jackson-core-asl to make it work

Maye answered 1/10, 2012 at 14:24 Comment(0)
E
1

Maven is unable to find the dependency for jackson-core-asl, you need to include following in your POM

<dependency>
    <groupId>org.codehaus.jackson</groupId>
    <artifactId>jackson-core-asl</artifactId>
    <version>1.9.0</version>
</dependency>

If its already included, then you might have to specify the repository. Check maven repository

Echinus answered 29/9, 2012 at 10:36 Comment(3)
Hi Anshu, Thanks for the prompt response. Just figured out the issue. Issue was with specific range. it was mentioned as 1.8-1.9 If i change it to 1.9. Its working fine. Thanks once again.Congruity
Well, that doesn't explain much. Why is the version range not working? Having the same problem apparently caused by one of our dependencies. Specifying a specific version in our pom doesn't seem to helpPooi
This won't help if this dependency is transitive and is brought to your project from another dependency. Try to find out which dep is causing this problem and update its version. Maybe will help. In my case it was an expired version of Amazon SDK (1.3.11)Convexoconcave

© 2022 - 2024 — McMap. All rights reserved.