sbt

How to define build-scoped settings in multi-project .sbt builds?

为君一笑 提交于 2020-01-04 03:54:10
问题 As of sbt 0.13, the recommended way to define all configuration is multi-project .sbt build definition. It is absolutely clear how to define settings for each project there; however, how one should define build-wide settings, for example, in ThisBuild or Global scopes? With Scala build definitions it is clear: we have settings key coming from Build trait: object MyBuild extends Build { override lazy val settings = super.settings ++ Seq( someKey := someValue ) } Now someKey 's value will be

sbt-idea 1.2.0 unresolved for SBT 0.12.0 and Scala 2.10.0?

无人久伴 提交于 2020-01-04 03:16:07
问题 I am creating a new SBT project and here are the contents of my SBT files: build.properties sbt.version=0.12.0 plugins.sbt addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.2.0") build.sbt name := "peroo" version := "0.1-SNAPSHOT" scalaVersion := "2.10.0" resolvers ++= Seq( Classpaths.typesafeResolver, "Sonatype snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/", "Sonatype releases" at "https://oss.sonatype.org/content/repositories/releases/" ) libraryDependencies ++=

How to handle multiple build targets, e.g. dev, test, main?

时光怂恿深爱的人放手 提交于 2020-01-04 03:15:23
问题 I'm currently migrating from Maven to SBT, and I'm struggling to understand how I can handle multiple build targets (dev, test, train, prod etc). For example, I have a persistence.xml that looks like this: <properties> <property name="javax.persistence.jdbc.driver" value="oracle.jdbc.driver.OracleDriver"/> <property name="javax.persistence.jdbc.url" value="${db.connectionURL}"/> <property name="javax.persistence.jdbc.user" value="${db.username}"/> <property name="javax.persistence.jdbc

'ensime generate' is not a valid sbt command

你。 提交于 2020-01-04 02:58:12
问题 I'm trying to use sbt to generate an ensime configuration file as described in this tutorial: http://jawher.net/2011/01/17/scala-development-environment-emacs-sbt-ensime/ The issue I'm having is that I cannot get sbt to generate a configuration file as the 'ensime generate' command does not appear to be part of the sbt command set. [output] [info] Building project ScalaTest 1.0 against Scala 2.9.2 [info] using sbt.DefaultProject with sbt 0.7.7 and Scala 2.7.7 [error] No method named 'ensime'

How to resolve dependency conflict of an SBT dependency?

雨燕双飞 提交于 2020-01-04 01:58:17
问题 I have a project's build.sbt which is using : libraryDependencies ++= Seq( "com.lerestau" % "killer-launcher" % "1.0.2", "com.lerestau" % "menu-starter" % "1.0.0" ) menu-starter transitively downloading "killer-launcher" % "0.0.8" and Hence getting errors in current project. Is there any way to resolve this sort of conflict. I came up with dependencyOverrides , but that works if conflict is entirely binary. That didn't work. How to resolve in SBT ? 回答1: The following should get rid of the

sbt 0.13.1 multi-project module not found when I change the sbt default scala library to scala 2.11.2

本小妞迷上赌 提交于 2020-01-03 21:01:49
问题 I use the sbt 0.13.1 create the two modules, and I create project/MyBuild.scala to compile this two modules. MyBuild.scala: import sbt._ import Keys._ object MyBuild extends Build { lazy val task = project.in(file("task")) lazy val root = project.in(file(".")) aggregate(task) dependsOn task } When I change the scala library to 2.11.2 by set scalaHome . It will go to maven download the task.jar and failed, that's very strange. Is it a sbt bug? There is the github test project address: test-sbt

Unresolved dependencies path for SBT project in IntelliJ

▼魔方 西西 提交于 2020-01-03 17:47:09
问题 I'm using IntelliJ to develop Spark application. I'm following this instruction on how to make intellij work nicely with SBT project. As my whole team is using IntelliJ so we can just modify build.sbt but we got this unresolved dependencies error Error:Error while importing SBT project: [info] Resolving org.apache.thrift#libfb303;0.9.2 ... [info] Resolving org.apache.spark#spark-streaming_2.10;2.1.0 ... [info] Resolving org.apache.spark#spark-streaming_2.10;2.1.0 ... [info] Resolving org

Real SBT Classpath at Runtime

巧了我就是萌 提交于 2020-01-03 17:45:07
问题 I have some test cases that need to look at the classpath to extract the paths of some files/directories in there. This works fine in the IDE. The problem is that, when running SBT test, Properties.javaClassPath gives me /usr/share/sbt-launcher-packaging/bin/sbt-launch.jar . The classpath is fine when I run show test:dependency-classpath . Is there a way to obtain that information from inside the running Scala/Java program? Or is there a way to toss it into a system property or environment

unresolved dependency org.mongodb#bson#2.5, bad organisation in sbt

牧云@^-^@ 提交于 2020-01-03 17:23:30
问题 I'm trying to use "org.apache.mahout" % "mahout-integration" % "0.7" as a dependency inside my play2 based web application. [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: UNRESOLVED DEPENDENCIES :: [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: org.mongodb#bson;2.5: java.text.ParseException: inconsistent module descriptor file found in 'http://repo1.maven.org/maven2/org/mongodb/bson/2.5/bson-2.5.pom': bad organisation: expected='org.mongodb' found='org.bson';

Sbt can't authorize in Artifactory

雨燕双飞 提交于 2020-01-03 15:54:48
问题 I'm behind corporate proxy server with domain authorization. There is Artifactory in the company and one should use domain credentials to login in it. When I try to run sbt in my Play! project folder I get next output: j:\Education\Scala\taxi\sources\branches\dev>sbt [info] Loading project definition from J:\Education\Scala\taxi\sources\branches\dev\project [info] Updating {file:/J:/Education/Scala/taxi/sources/branches/dev/project/}dev-build... [info] Resolving com.typesafe.play#sbt-plugin;2