sbt

sbt with sub-modules and multiple scala versions

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 16:22:30
问题 I'm building a scala applications with these module and dependencies : a shared lib "common" module "A" depends on "common" and can be built in scala 2.10 only module "B" depends on "common" and can be built in scala 2.11+ only I'm trying to have all the 3 modules in a single sbt build : import sbt._ import Keys._ lazy val root = (project in file(".")) .aggregate(common, A, B) lazy val common = (project in file("common")) lazy val A = (project in file("A")) .dependsOn(common) lazy val B =

Play dist task: how to prevent conf files to be packed

ぐ巨炮叔叔 提交于 2019-12-24 16:13:06
问题 When running dist task, distribution package includes conf files (from <app>/conf ) in two places: <app.zip>/conf <app.zip>/lib/<app.jar> This means that application.conf (and all the other conf files whithin <app>/conf ) will be placed both in the root of the zip package, and in the root of the main jar library. When running the application, files inside jar are the ones used, so copies in the <unzipped-app>/conf are completely ignored. I'm wondering which is the best practice here: I think

sbt package to create a standalone jar in sbt 0.11.2

醉酒当歌 提交于 2019-12-24 15:27:45
问题 How can I produce a standalone jar in sbt 0.11.2 ? Right now I'm trying sbt package and when I try to run java -jar app.jar on the produced jar file, it gives the following exception: Exception in thread "main" java.lang.NoClassDefFoundError: scala/App at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java

Test cleanup hook not executed in scala play application

旧时模样 提交于 2019-12-24 14:43:12
问题 Below is my Build.scala file There is no error in test, but the cleanup hook is not executed after test what is the issue? import play.Project._ import sbt._ import sbt.Keys._ object AppBuild extends Build { val appName = "test" val appVersion = "1.0" val dependencies = Seq( "org.scalatest" % "scalatest_2.10" % "2.0.RC1" ) val main = play.Project( appName, appVersion, dependencies, settings = Defaults.defaultSettings ) .settings( scalaVersion := "2.10.1", testOptions in Test += Tests.Cleanup

Playframework 2.1 slow resolving of internal dependencies

你说的曾经没有我的故事 提交于 2019-12-24 14:33:49
问题 We're using a in house sonatype repository for our own libraries which our play project depend upon. Lately the project have been taking around 10 minutes to start (using play run) because the resolving is slow. Trying to see what's happening I'm running a ngrep port 80 . I see alot of slow responses from the typesafe repository which answer that our own libraries isn't in their repo. Example: T <my-internal-ip>:41907 -> 54.236.91.228:80 [AP] HEAD /typesafe/snapshots/<our-pom-file-here> HT TP

How do I compile Java 8 sources with SBT

泄露秘密 提交于 2019-12-24 14:27:55
问题 I am trying to compile a project containing some Java 8 source files using lambdas using SBT 0.13.7. Now, I set -java-home /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Home in /usr/local/etc/sbtopts And apparently SBT does take this into consideration, because if I supply the wrong path it complains about no java being present. However, when I try compiling, I get the following [error] /Users/edafinov/GitRepos/Java8SBTTest/src/main/java/Main.java:10: error: illegal start of expression

Sbt assembly hangs on my Mac

点点圈 提交于 2019-12-24 13:33:13
问题 I have had this problem since the day I started using assembly . sbt assembly (for any project) never completes on my Mac. It just hangs at the last step . For this one reason . I transfer my code to a Linux box and build there . Anyone else has experienced this ? . Any ideas on how I can go about debugging ? . I had Lion with Java 1.6.0_37 . Now upgraded to Mountain Lion 回答1: I had the same problem some time ago. Do you have anti-virus software installed? In my case it was Sophos, that tried

SparkContext Not Being Initialized after sbt run

試著忘記壹切 提交于 2019-12-24 13:21:04
问题 I have my build.sbt file below: name := "hello" version := "1.0" scalaVersion := "2.11.8" val sparkVersion = "1.6.1" libraryDependencies ++= Seq( "org.apache.spark" %% "spark-core" % sparkVersion, "org.apache.spark" %% "spark-streaming" % sparkVersion, "org.apache.spark" %% "spark-streaming-twitter" % sparkVersion ) I also have example.scala in src/main/scala/example.scala : import org.apache.spark._ import org.apache.spark.SparkContext._ object WordCount { def main(args: Array[String]) { val

Disable sbt subproject doc generation

守給你的承諾、 提交于 2019-12-24 13:13:47
问题 I have a multi-project Scala build in SBT, in which I have a root project that effectively just aggregates two subprojects: a macro library and a core library that uses that macro library. I'm using the excellent sbt-unidoc plugin to create a single, unified scaladoc API for the entire library (macro + core combined). Unfortunately, sbt-unidoc has some limitations. For instance, by default, it does not hook into the doc task, and its output is placed in the target directory's unidoc folder,

How can I add a dependency to my sbt plugin?

两盒软妹~` 提交于 2019-12-24 12:51:26
问题 I would like to add a library that I am going to use within the code of my SBT-Plugin. I did ... sbtPlugin := true libraryDependencies += "..." %% "..." % "..." enablePlugins(SbtPlugin) scriptedLaunchOpts := { scriptedLaunchOpts.value ++ Seq("-Xmx1024M", "-Dplugin.version=" + version.value) } scriptedBufferLog := false ... in build.sbt located in the root of my plugin project. ▶ tree -L 1 . ├── README.md ├── build.sbt <- this one ├── project └── src But when I run the test, following: https:/