sbt

Tell SBT to collect all my dependencies together

杀马特。学长 韩版系。学妹 提交于 2019-12-20 18:26:08
问题 When building a web application SBT is able to collect all my jar dependencies into the WAR file. Is this possible to have SBT put all the jars I depend on in my non-web application into a directory so I can easily put them onto my class path when running the app? 回答1: Yes, you can put something like this in your project definition class: val libraryJarPath = outputPath / "lib" def collectJarsTask = { val jars = mainDependencies.libraries +++ mainDependencies.scalaJars FileUtilities.copyFlat

How can an SBT plugin depend on another plugin

喜你入骨 提交于 2019-12-20 17:31:48
问题 I want to write a plugin "MyPlugin" that depends on the another plugin ("io.spray" %% "sbt-twirl" % "0.6.0"). Simply adding sbt-twirl in libraryDependencies will not work, because plugins get published with a different path scheme than standard libraries. I also cannot declare sbt-twirl as a plugin dependency to MyPlugin project, because MyPlugin does not use the sbt-twirl directly, it is the project using MyPlugin that will indirectly use it. MyPlugin provides a task that is meant to be run

Why did sbt formerly (version ≤ 0.13.6) require blank lines between settings in .sbt files?

岁酱吖の 提交于 2019-12-20 17:20:09
问题 So for example you couldn't write: a := 3 b := 4 You had to separate them, like this: a := 3 b := 4 I can't think of another file format with a similar requirement. It was definitely surprising to newcomers. Even some longtime sbt users considered it objectionable. In my experience, this was the single frequently-most-asked question about sbt, before it was changed. 回答1: As of sbt 0.13.7, the blank lines are no longer required. So the following is now historical information. The short answer

Why did sbt formerly (version ≤ 0.13.6) require blank lines between settings in .sbt files?

穿精又带淫゛_ 提交于 2019-12-20 17:17:09
问题 So for example you couldn't write: a := 3 b := 4 You had to separate them, like this: a := 3 b := 4 I can't think of another file format with a similar requirement. It was definitely surprising to newcomers. Even some longtime sbt users considered it objectionable. In my experience, this was the single frequently-most-asked question about sbt, before it was changed. 回答1: As of sbt 0.13.7, the blank lines are no longer required. So the following is now historical information. The short answer

Play framework and sbt: passing credentials to a nexus passowrd protected repo

我与影子孤独终老i 提交于 2019-12-20 14:18:27
问题 I need to define as a dependency the following library: url: http://deploy.cloud.testmx.com:8081/nexus/content/groups/public/ user: testmx pass: testmx@testmx groupId: testmx artifactId: testmxcommons version: 1.0.0-SNAPSHOT So I defined the following project/Build.scala import sbt._ import Keys._ import PlayProject._ object ApplicationBuild extends Build { val appName = "testmxproject" val appVersion = "1.0-SNAPSHOT" val appDependencies = Seq( "mysql" % "mysql-connector-java" % "5.1.18",

Play framework and sbt: passing credentials to a nexus passowrd protected repo

99封情书 提交于 2019-12-20 14:16:47
问题 I need to define as a dependency the following library: url: http://deploy.cloud.testmx.com:8081/nexus/content/groups/public/ user: testmx pass: testmx@testmx groupId: testmx artifactId: testmxcommons version: 1.0.0-SNAPSHOT So I defined the following project/Build.scala import sbt._ import Keys._ import PlayProject._ object ApplicationBuild extends Build { val appName = "testmxproject" val appVersion = "1.0-SNAPSHOT" val appDependencies = Seq( "mysql" % "mysql-connector-java" % "5.1.18",

使用sbt构建spark 程序

大兔子大兔子 提交于 2019-12-20 12:19:06
今日在学习scala和spark相关的知识。之前在eclipse下编写了wordcount程序。但是关于导出jar包这块还是很困惑。于是学习sbt构建scala。 关于sbt的介绍网上有很多的资料,这里就不解释了。参考:http://wiki.jikexueyuan.com/project/sbt-getting-started/install-sbt.html 关于linux下(centos)安装sbt: 依次执行 curl https://bintray.com/sbt/rpm/rpm > bintray-sbt-rpm.repo sudo mv bintray-sbt-rpm.repo /etc/yum.repos.d/ sudo yum install sbt 使用sbt需要按照sbt的要求生成相关的目录: 其中,kafka是项目根目录,build.sbt的内容如下: name := "test" version := "1.0" scalaVersion := "2.10.5" libraryDependencies += "org.apache.spark" % "spark-streaming_2.10" % "1.6.2" % "provided" libraryDependencies += "org.apache.spark" %% "spark-core" %

How to configure sbt test / ScalaTest to only show failures?

倾然丶 夕夏残阳落幕 提交于 2019-12-20 11:34:11
问题 Is there a way to truncate the test results to only show result text for unit tests only when the unit test has failed? I'm working on a Scala project that has 850 unit tests, and the green text from the successful unit tests makes it difficult to focus on just the failures. Example of what I'm talking about: [info] - should have colors [info] - should not be dead //.... x 100 [info] - animals should not be rainbows *** FAILED *** [info] -"[rainbow]s" was not equal to "[ponie]s"

Why are integration tests in a Play/Scala project not executed when using “sbt it:test”?

自作多情 提交于 2019-12-20 10:36:49
问题 I have a Play Framework 2.3 project in which I'd like to separate unit tests and functional tests as follows: running sbt test should run unit tests and exclude integration tests running sbt it:test should run integration tests only The Scala documentation suggests using project/Build.scala , but I'd like to use combination of build.sbt and project/Build.scala , so my configuration looks like this (I have also tried putting all of configuration into Build.scala ): build.sbt ....

How to fix this “sbt.ResolveException: unresolved dependency: commons-logging#commons-logging;1.1.1:” exception?

旧街凉风 提交于 2019-12-20 10:36:10
问题 I just clone the project scala-js-react, and run sbt , it reports some error about dependency. I tried to fix it by add some resolvers, but no lucky. $ git clone https://github.com/xored/scala-js-react.git $ cd scala-js-react $ sbt Reports error: [info] Loading project definition from /Users/twer/workspace/scala-js-react/project [info] Updating {file:/Users/twer/workspace/scala-js-react/project/}scala-js-react-build... [info] Resolving org.scala-sbt.ivy#ivy;2.3.0-sbt