sbt

Publish SBT project to local directory

不羁的心 提交于 2019-12-21 03:52:37
问题 I am trying to publish some of my SBT projects on my personal webserver. As far as I know you usually export a SBT project as a Maven directory including a POM.xml, that contains the project definitions. As Brian Clapper pointed out, you can publish such a Maven repository by creating several configuration files and using sbt publish . In his tutorial, the repository is transferred via FTP. I want to push my Maven repository to the server manually so I have more control. Can you give me some

How can I add unmanaged JARs in sbt-assembly to the final fat JAR?

久未见 提交于 2019-12-21 03:42:55
问题 My project has dependencies on a JAR file that isn't in Ivy, how can I include it directly in the final JAR output by sbt-assembly? 回答1: Figured out I just have to add them explicitly as unmanaged dependencies in Build.scala , they are not automatically pulled in from the lib folder. Adding this line to settings worked: unmanagedJars in Compile += file("lib/vertica_jdk_5.jar") 回答2: For a single project setup, putting jars into lib should work. If you have multi-project setup the lib directory

Play! framework: customize which tests are run

这一生的挚爱 提交于 2019-12-21 03:38:18
问题 I have a Play! 2 for Scala application, and I am using Specs2 for tests. I can run all tests with the test command, or a particular specification with test-only MyParticularSpec . What I would like to do is mark some particular specifications, or even single methods inside a specification, in order to do things like: running all tests that are not integration (that is, that do not access external resources) running all tests that do not access external resources in write mode (but still

Run ScalaTest tests in parallel

雨燕双飞 提交于 2019-12-21 03:28:11
问题 Given the following test suite: class ParallelizeMe extends FunSuite with BeforeAndAfterAll { override def beforeAll() = println("before") override def afterAll() = println("after") test("test 1") { println("1a") Thread.sleep(3000) println("1b") } test("test 2") { println("2a") Thread.sleep(1000) println("2b") } } How can I run the tests (via sbt) in parallel? Ideally, I want the order of execution to produce the following on stdout: before 1a 2a 2b 1b after 回答1: Use ParallelTestExecution and

Scala sbt: Multiple dependencies in sbt

折月煮酒 提交于 2019-12-21 03:17:20
问题 I am a new user to Scala, following the way to create a scala sbt project. https://www.youtube.com/watch?v=Ok7gYD1VbNw After adding libraryDependencies += "org.scalatest" % "scalatest_2.11" % "2.2.4" % "test" to build.sbt , and refreshed the project, I got this msg. [warn] Multiple dependencies with the same organization/name but different versions. To avoid conflict, pick one version: [warn] * org.scala-lang:scala-reflect:(2.11.2, 2.11.7) [warn] * org.scala-lang.modules:scala-xml_2.11:(1.0.2

How to add Jar libraries to an IntelliJ Idea SBT Scala project?

喜你入骨 提交于 2019-12-21 03:11:11
问题 I've created an IntelliJ Idea SBT Scala project like Heiko Seeberger's article describes. I'd like to add a Jar library (joda-time) to use in this project. How to do this? Simply putting them into project's /lib does not help. If I right-click "External libraries" in Idea's project tree, "New >" is greyed. 回答1: In the IntelliJ Idea window of your project, got to File >> Project structure >> Libraries. After clicking that Libraries option, two panes will show up. At the top of the left-most

How to change the default port 9000 in Play 2.3.x in build definition?

纵然是瞬间 提交于 2019-12-21 02:48:15
问题 With Play 2.2.x I could set the default port with build.sbt file i.e: Build.sbt play.Project.playScalaSettings play.Project.playDefaultPort := 9001 After 2.3.x upgrade play.Project.playDefaultPort does not exists any more. I do not want to type -Dhttp.port=9001 or run 9001 回答1: play.PlayImport.PlayKeys.playDefaultPort := 9001 https://github.com/playframework/playframework/blob/2.3.4/framework/src/sbt-plugin/src/main/scala/PlayImport.scala#L111 来源: https://stackoverflow.com/questions/26040275

Add a compile time only sub-project dependency in sbt

怎甘沉沦 提交于 2019-12-21 02:34:08
问题 I have a multi-project contains a private macro sub-project which's usage is limited to implement method body of other sub-projects. Neither should it be on the runtime classpath of other sub-projects, nor should it be visible in any form in the published POM of other sub-projects. So that other sbt project could use library from this project without knowing the macro sub-project. For external dependency, I found this SO Q&A works perfectly, but for sub-project when I trying to do the similar

Scala SBT Assembly cannot merge due to de-duplication error in StaticLoggerBinder.class

有些话、适合烂在心里 提交于 2019-12-20 20:02:58
问题 My problem is I can no longer use the sbt-assembly plugin because some kind of dependency merge problem creeped in, between a couple people working on this project. The problem when I run 'sbt assembly' : [error] 3 errors were encountered during merge java.lang.RuntimeException: deduplicate: different file contents found in the following: /Users/aris.vlasakakis/.ivy2/cache/ch.qos.logback/logback-classic/jars/logback-classic-1.1.2.jar:org/slf4j/impl/StaticLoggerBinder.class /Users/aris

How to set default dependencies for all subprojects in SBT?

蹲街弑〆低调 提交于 2019-12-20 19:43:57
问题 Trying to understand how to set up SBT subprojects. What is the correct way to set default dependencies for all my sub projects? I tried this, but my sub projects weren't picking up any of the dependencies (they downloaded fine). import sbt._ class MyProjects(info: ProjectInfo) extends DefaultProject(info) { val projA = project("projA", "ProjectA") val projB = project("projB", "ProjectB") val akkaRepo = "Akka maven2 repo" at "http://www.scalablesolutions.se/akka/repository/" val