sbt

How can one change the location of the “webapp” directory for a Scalatra application?

烂漫一生 提交于 2019-12-22 05:57:08
问题 By default, Scalatra expects the "webapp" directory to be at src/main/webapp . How could that be changed to, e.g., content/doc-root ? sbt allows for customizing its default directories using something like the following: scalaSource <<= (baseDirectory)(_ / "src") So I assume it's just a matter of knowing the right "configuration key" to use... 回答1: @Kelsey Gilmore-Innis has the right answer, but since it's not accepted let's break it, break it, break it down. First, I'm assuming you're

Unresolved dependency SBT org.scala-sbt#sbt_2.9.1;0.12.1: not found, Play examples

余生长醉 提交于 2019-12-22 04:52:09
问题 I am trying to run the samples in Play 2.0 framework but when I go to run "play" or "sbt". When I go to directory "/samples/scala/helloworld", I execute "sbt" and I obtain: [info] Loading project definition from C:\src\Play20\samples\scala\helloworld\project [warn] module not found: play#sbt-plugin;2.0 [warn] ==== typesafe-ivy-releases: tried [warn] http://repo.typesafe.com/typesafe/ivy-releases/play/sbt-plugin/scala_2.9.2/sbt_0.12/2.0/ivys/ivy.xml [warn] ==== sbt-plugin-releases: tried [warn

Why does publishing plugin project fail with RuntimeException: Repository for publishing is not specified?

▼魔方 西西 提交于 2019-12-22 04:39:26
问题 I am trying to publish an SBT plugin to a repository. I'm not sure if this has any relevance, but our plugin loads the sbt-twirl plugin - Googling around, it seems like publishConfiguration might be overriden: new PublishConfiguration(None, "dotM2", arts, Seq(), level) When I run the publish task, artifacts are deployed to the repo, but the sbt task then fails: sbt (my-sbt-plugin)> publish [info] Loading global plugins from ... ... [info] Done packaging. [info] published sbt-my-sbt-plugin to

Setting up actions for multiple test folders in SBT

痞子三分冷 提交于 2019-12-22 04:27:13
问题 In relation to a previous question, I'd like to have multiple test folders for different types of test and be able to execute the tests contained in each folder with a separate SBT action. For example, an action 'test-unit' would run only the tests contained under the folder src/test/scala/unit , and a 'test-functional' action would run only the tests under src/test/scala/functional . How would we write actions to do this? 回答1: If you are using xsbt 0.10.0, you can easily create additional

How to use plugin in sbt project when only the plugin's sources available?

北战南征 提交于 2019-12-22 04:16:17
问题 I want to use the sbt-scrooge plugin, but its repo is unavailable now - http://koofr.github.com/. I thought I'd include this plugin's source code directly in my own repo (as a git submodule). I tried: git submodule add https://github.com/bancek/sbt-scrooge.git project/sbt-scrooge and added: addSbtPlugin("net.koofr" % "sbt-scrooge" % "3.0.45") to project/plugins.sbt . But it doesn't work - the following exception is thrown: sbt.ResolveException: unresolved dependency: net.koofr#sbt-scrooge;3.0

Can't set memory settings for `sbt start`

余生颓废 提交于 2019-12-22 04:12:28
问题 I'm trying to run sbt start in a Play Framework application written in Scala, on a machine that is an ec2 t2.micro instance on AWS. But i can't because There is insufficient memory for the Java Runtime Environment to continue. The machine has 1GB of memory, but in practice 930MB of free memory to use while running the remaining of OS processes. It is Ubuntu Server 14.04 LTS. The app is small, cute. Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000d5550000,

How to make task depend on another in sbt 0.12?

百般思念 提交于 2019-12-22 04:08:32
问题 I'm using SBT 0.12.0 . I've two tasks in my project/Build.scala - helloTask and u2 defined as follows: val hello = TaskKey[Unit]("hello", "Prints 'Hello World'") val helloTask = hello := { println("Hello World") } val u2Task = TaskKey[Unit]("u2") := { println("u2") } How to make u2 task depend on hellotask ? I used <<= following the sample as described in Tasks (in the original version of the question it was https://github.com/harrah/xsbt/wiki/Tasks, but the doc has since moved and changed).

SBT resolution fails with Ivy extra attributes

我们两清 提交于 2019-12-22 04:06:56
问题 I'm trying to use Ivy extra attributes with SBT. I have two modules: foo-model and foo-api. For both of them I added this to build.sbt : projectID <<= projectID { id => id extra("branch" -> "master-api-model-separation") } Foo-model is being published to Artifactory (with sbt publish). The published POM file looks like this: <?xml version='1.0' encoding='UTF-8'?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www

How to load setting values from a Java properties file?

纵饮孤独 提交于 2019-12-22 04:05:35
问题 Is there a way for me to dynamically load a setting value from a properties file? I mean, instead of hardcoding into build.sbt name := "helloWorld" Have some application.properties file with name=helloWorld And then, in the build.sbt file, have name := application.properties["name"] (last example is purely schematic, but I hope the idea was clear) 回答1: You can create a setting key which holds properties read from a file. import java.util.Properties val appProperties = settingKey[Properties](

Run project with java options via sbt

眉间皱痕 提交于 2019-12-22 03:58:59
问题 I am running my fat jar with command java -Djava.security.krb5.conf=/krb5.conf -jar my.jar . How to run my app with this option via sbt? $ sbt -Djava.security.krb5.conf="module\\src\\main\\resources\\krb5.conf" run doesn't work. Error: ctl-scala>sbt -Djava.security.krb5.conf="ctl-core\src\main\resources\krb5.conf" ctl-ui-backend/run Warning: invalid system property 'java.security.krb5.conf' [info] Loading global plugins from C:\Users\User\.sbt\0.13\plugins [info] Loading project definition