IllegalStateException: impossible to get artifacts when data has not been loaded for Guava 12.0?

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.

Integrating native system libraries with SBT

From the research I’ve done in the past, there are only two ways to get native libraries loaded: modifying java.library.path and using System.loadLibrary (I feel like most people do this), or using System.load with an absolute path. As you’ve alluded to, messing with java.library.path can be annoying in terms of configuring SBT and Eclipse, and … Read more

Is the use of ‘aggregate’ following by ‘dependsOn’ redundant with the same modules?

tl;dr aggregate causes the tasks to be executed in the aggregating module and all aggregated one while dependsOn sets a CLASSPATH dependency so the libraries are visible to the aggregateing module (depending on the configuration that’s compile aka default in the example). A sample to demonstrate the differences. I’m using the following build.sbt (nothing really … Read more

How to use Environment Variables in build.sbt?

You can get env variables with the commands mentioned other responses like: sys.env.get(“USERNAME”) sys.env.get(“PASSWORD”) but they return an option of type Option[String] To turn this into string you need to either do a match or simply use sys.env.get(“USERNAME”).get sys.env.get(“USERNAME”).getOrElse(“some default value”) if you need to set some default value. Warning! calling .get of an option … Read more

How to stop Intellij from automatically running SBT

I would leave the autoimport checkbox unchecked when importing a SBT project. In this way, it doesn’t refresh automatically, it must be done by hand. In order to change it, after it has been imported, you can edit by hand the .idea/sbt.xml file: <project version=”4″> <component name=”ScalaSbtSettings”> <option name=”linkedExternalProjectsSettings”> <SbtProjectSettings> <option name=”externalProjectPath” value=”$PROJECT_DIR$” /> <option … Read more

Warnings while building Scala/Spark project with SBT

Is there a better way to structure build.sbt (add other resolvers e.g.?), so that I can get rid off the warnings? One way is to manually tell sbt what dependencies you prefer, for your case: dependencyOverrides ++= Set( “io.netty” % “netty” % “3.9.9.Final”, “commons-net” % “commons-net” % “2.2”, “com.google.guava” % “guava” % “11.0.2” ) I … Read more

where to find downloaded library of sbt?

All new SBT versions (after 0.7.x) by default put the downloaded JARS into the .ivy2 directory in your home directory. If you are using Linux, this is usually /home/<username>/.ivy2/cache. If you are using Windows, this is usually c:\Users\<username>\.ivy2\cache. EDIT: Here’s an example from one of my projects, in which I define an SBT task that … Read more

Adding new task dependencies to built-in SBT tasks?

Since this question appears when Googling how to add a dependency in SBT, and the current answers are deprecated as of 0.13.x and removed in 1.0, here’s the updated answer, assuming that printAction is the task that compile should depend on: (Compile / compile) := ((Compile / compile) dependsOn printAction).value