sbt

How to run Spark scala application inside Intellij

匆匆过客 提交于 2019-12-23 19:21:13
问题 I'm trying to run a simple Spark application using Intellij on Hortonworks sandbox. I've opened a new SBT project, then created a Scala class: import org.apache.spark.SparkContext import org.apache.spark.SparkContext._ import org.apache.spark.SparkConf object SimpleApp { def main(args: Array[String]) { val logFile = "/root/temp.txt" val conf = new SparkConf().setAppName("Simple Application") val sc = new SparkContext(conf) val logData = sc.textFile(logFile, 2).cache() println(logData .count()

sbt stuck while downloading

被刻印的时光 ゝ 提交于 2019-12-23 19:13:51
问题 a couple days ago i started to learn scala. I want to use sbt for the dependency management but when i start sbt in my console it need round about 1h to resolving and downloading all dependencies. My search at google was unsuccessfull so i hope somebody can help me to speed up sbt. My build.sbt name := "hello" version := "1.0" scalaVersion := "2.11.2" scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8") libraryDependencies ++= { val akkaV = "2.3.5" val sprayV = "1.3.1" Seq(

Weird spurious errors during compilation of Play / Activator program?

谁都会走 提交于 2019-12-23 17:11:07
问题 I have a large and moderately complex web application, using the standard Typesafe Stack of Play, Scala and Akka. (I'm in the process of adding scala.js, but this problem predates that.) A couple of months ago, I upgraded to the current Activator-based version of the world (having fallen behind the times), and that's mostly worked fine. But ever since then, I am semi-frequently getting a weird error when I try to compile: [Querki] $ compile [trace] Stack trace suppressed: run last scalajvm

How to set up multi-module build with reference to external local sbt project?

牧云@^-^@ 提交于 2019-12-23 17:01:36
问题 I just started with Scala and Play and I'm trying to set up a multi build with sbt 0.13.5 My project structure is the following: /AnormCypher -> /src ->/main ->/scala ->org.anormcypher[package] ->[Some classes] -> [other dirs/files] -> build.sbt /sample -> /src ->/main ->/scala ->/controllers[package] ->Application.scala ->[Some classes] -> [other dirs/files] -> build.sbt The sample project depends on the AnormCypher project. I tried to set up the dependency following this SO post. My build

How can I change the directory into which SBT puts test resources?

人走茶凉 提交于 2019-12-23 15:00:46
问题 I want the test-compile action to put the contents of src/test/resources into target/scala_2.8.1/test-classes. The reason for this is that I'm running SBT with IntelliJ IDEA, which puts the test-classes directory on the classpath when it runs tests. My logback-test.xml file (configuration for logback logging framework) lives in src/test/resources, and it's not being found during testing. 回答1: This doesn't directly answer your question, but instead shows an the alternative that I use. I add

How to filter files that sbt watches for changes?

大兔子大兔子 提交于 2019-12-23 13:27:10
问题 I use emacs as my editor, and it has a nasty habit of creating locks for files near those files. It seems that sbt treats that locks as source files as well, and this results in a lot of unnecessary rebuilds. Is there a way to tell sbt that it shouldn't watch for changes in the files, whose names start with .# ? I tried something along the lines of: watchSources in Compile <<= (watchSources in Compile) map { files => println(files) files.filter(f => !f.getName.startsWith(".#")) } but it doesn

SBT hangs waiting for orphaned subprocess to complete

Deadly 提交于 2019-12-23 13:04:43
问题 In my SBT (0.13.16) build, I have the following task: startThing := { var bin_path = s"${file(".").getAbsolutePath}/bin" val result = s"$bin_path/start_thing".! if (result != 0) throw new RuntimeException("Could not start Thing..") true } And start_thing contains: (run_subprocess &) and my build hangs. I can see that start_thing exits (the process table does not have it as an entry) but adding some println s to the task shows that it's stuck on val result = s"$bin_path/start_thing".! . If I

Cannot find sbt launcher 0.11.2

痴心易碎 提交于 2019-12-23 12:45:35
问题 I have a Play 2.0 app that uses sbt 0.11.2 . However when I set up a new Play server, it grabbed the latest version of sbt 0.11.3 . Now when I run sbt compile on the new server, it complains Detected sbt version 0.11.2 Cannot find sbt launcher 0.11.2 Please download: /sbt-launch.jartypesafe.artifactoryonline.com/typesafe/ivy-releases/org.scala-tools.sbt/sbt-launch/0.11.2 /sbt-launch.jarc2-user/.sbt/.lib/0.11.2 I tried downloading sbt-launch 0.11.2 and putting in the same folder as sbt but

How to access SBT settings from Java code in PlayFramework?

孤人 提交于 2019-12-23 12:23:59
问题 I have a PlayFramework application, and there is a name and version in the build.sbt . If I run the play console, I can access this information by typing name or version . How can I get this information from Java code inside the application? I can't seem to find any useful methods in Play.application() and I have not been able to find this in the documentation. 回答1: For this you can use the SBT plugin BuildInfo: Add to project/plugins.sbt: addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.2

How do I change universal zip file name using sbt-native-packager

*爱你&永不变心* 提交于 2019-12-23 12:08:44
问题 I am using: scala 2.10.3 sbt 13.2 with plugin: addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "0.7.3") I am using the universal:packgeBin to generate the universal zip file and publish to ivy repository. I'd like to change the zip file name from project_id_scalaversion_buildVersion.zip to project_id_scalaversion_buildVersion_dist.zip . How would I do that? 回答1: This answer is based on version 1.0.3 that I have used, but it should apply to the latest version (1.1.5) as well. You can