32

In a Java Play 2.1.1 app I get the following error:

[myproject] $ update
[info] Updating {file:/C:/path/myproject/}myproject...
[info] Resolving ...
[error] impossible to get artifacts when data has not been loaded. IvyNode = com.google.guava#guava;12.0
[error] (*:update) java.lang.IllegalStateException: impossible to get artifacts when data has not been loaded. IvyNode = com.google.guava#guava;12.0
[error] Total time: 230 s, completed 17.05.2013 19:16:41

Build.scala

"com.google.guava" % "guava" % "14.0.1",
"org.mydependency" % "mydependency" % "1.0-SNAPSHOT" changing() exclude("org.jboss.netty","netty") exclude("com.google.guava", "guava") exclude("log4j", "log4j"),

The thing that causes this error (it all worked fine before) is a dependency change within mydependency:

old:

<dependency>
    <groupId>com.thinkaurelius.titan</groupId>
    <artifactId>titan-berkeleyje</artifactId>
    <version>0.3.1</version>
</dependency>

new:

<dependency>
    <groupId>com.thinkaurelius.titan</groupId>
    <artifactId>titan-cassandra</artifactId>
    <version>0.3.1</version>
</dependency>

I don't want guava 12.0 anyway and it is and was excluded.

Can I tell Play 2.1.1 to use a newer Ivy?

In plugins.sbt I have:

addSbtPlugin("play" % "sbt-plugin" % "2.1.1")

Temporary fix As someone mentioned here Apache IVY error message? : impossible to get artifacts when data has not been loaded manually adding the dependency solves it: I've added

"com.google.guava" % "guava" % "12.0"

and the problem is gone.

Community
  • 1
  • 1
Gonfi den Tschal
  • 1,754
  • 1
  • 20
  • 29
  • 3
    I just ran into this one when I added a dependency that tries to transitively pull in *slf4j-api;1.6.1* when my project already includes *slf4j-api;1.7.5*. I worked around it by making said dependency `intransitive()`. – earldouglas Apr 22 '14 at 17:37
  • @gonfi-den-tschal Does the issue exist still? – Jacek Laskowski Jun 17 '14 at 19:41
  • Others still seem to have the issue. I have not come across it anymore, but then I'm still using the temporary fix. I have not touched this project nor upgraded Play in a while. – Gonfi den Tschal Aug 04 '14 at 20:00
  • 2
    @JacekLaskowski, I have had this issue with sbt 0.13.5 (commons-io 2.2 in my case) – Paul Draper Aug 05 '14 at 17:01

3 Answers3

14

Apparently more people had and have this issue, so I'm putting my solution as an answer:

Temporary fix As someone mentioned here Apache IVY error message? : impossible to get artifacts when data has not been loaded manually adding the dependency solves it: I've added

"com.google.guava" % "guava" % "12.0"

and the problem is gone.

Community
  • 1
  • 1
Gonfi den Tschal
  • 1,754
  • 1
  • 20
  • 29
9

Instead of using a lower version, you could try adding this line to .sbt file:

dependencyOverrides += "com.google.guava" % "guava" % "14.0.1"
jrook
  • 3,459
  • 1
  • 16
  • 33
4

Play 2.1.x uses sbt 0.12, which uses Ivy 2.3.0-rc1, but looks like this is still an issue. If you can come up with a reproduction steps using publicly available libraries, please open a Github issue with a link to this comment.

Eugene Yokota
  • 94,654
  • 45
  • 215
  • 319