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.

How to execute a bash script as sbt task?

You can find some answers in External Processes in the official documentation of sbt, e.g. To run an external command, follow it with an exclamation mark !: “find project -name *.jar” ! Don’t forget to use import scala.sys.process._ so ! can be resolved as a method of String. Do the following in activator console (aka … Read more

sbt assembly command not found

Did you create a assembly.sbt at the root of your project? Alongside your build.sbt? If so, then that’s the problem. You want to have it inside the project directory. Having done that it worked out the box as expected with the rest of your setup: > assembly [info] Including: scala-library.jar [info] Checking every *.class/*.jar file’s … Read more

How to disable ScalaDoc generation in dist task in Play 2.2.x (using project/build.scala)?

Add the following settings to the Play project: sources in (Compile,doc) := Seq.empty publishArtifact in (Compile, packageDoc) := false With the change it should be as follows: play.Project(appName, appVersion, appDependencies) .settings(scalaVersion := “2.10.3”) .settings(jsSettings : _*) .settings( publishArtifact in (Compile, packageDoc) := false, publishArtifact in packageDoc := false, sources in (Compile,doc) := Seq.empty ) Thanks … Read more

How to force a specific version of dependency?

you can use dependencyOverrides: dependencyOverrides += “foo” %% “foo” % “1.2.2” You’re not avoiding “logical inconsistencies” anyway. If you force a version, you have to manually take care of compatibility with other libraries, there’s no way out of that. From the documentation: Overriding a version For binary compatible conflicts, sbt provides dependency overrides. They are … Read more

How to make “test” classes available in the “it” (integration test) configuration?

You can redefine the IntegrationTest Configuration in your project to extend the Test configuration instead of the Runtime Configuration (the default). This will make everything in your test configuration available to your IntegrationTest configuration. import sbt._ import Keys._ object MyBuild extends Build { val scalaTest = “org.scalatest” %% “scalatest” % “2.0” % “test,it” lazy val … Read more

What are key differences between sbt-pack and sbt-assembly?

(Disclaimer: I maintain sbt-assembly) sbt-assembly sbt-assembly creates a fat JAR – a single JAR file containing all class files from your code and libraries. By evolution, it also contains ways of resolving conflicts when multiple JARs provide the same file path (like config or README file). It involves unzipping of all library JARs, so it’s … Read more

How to include an external jar file into the jar with package?

Try this libraryDependencies += “com.acme.common” % “commonclass” % “1.0” from “file:///Users/bwong/git/perf-tools/commonclass/target/scala-2.11/commonclass_2.11-1.0.jar” I “sbt package” the common classproject and then just add that library dependency in my build.sbt in the dependent projects. Thanks to http://flummox-engineering.blogspot.com/2014/06/sbt-use-jar-file-for-librarydependencies.html for this hack.