sbt

Disable aggregate for sbt custom task

 ̄綄美尐妖づ 提交于 2019-12-24 12:36:21
问题 How can I disable aggregate for a single custom task? I tried to add the following to my build.sbt : aggregate in myTaskName:= false But it doesn't work as I expected - I've got this error: ~\build.sbt:1: error: not found: value myTaskName aggregate in myTaskName:= false 回答1: Working example (sbt 0.13.5): val hello = TaskKey[Unit]("hello", "Prints 'Hello Zhu'") val helloTask = hello := { println("Hello Zhu") } aggregate in hello := false Note, that TaskKey was used - not the Setting[Task]

SBT ResolveException for org.flywaydb#flyway-sbt;3.1

牧云@^-^@ 提交于 2019-12-24 12:15:58
问题 I've been trying to use sbt for compiling the source code of a server app, written in scala. When I run the sbt script, it starts downloading some packages and resolving some dependencies and at the final step, it returns the following error: sbt.ResolveException: unresolved dependency: org.flywaydb#flyway-sbt;3.1:not found And if I ignore this error, I can't use commands like "compile", ... I have compiled this source code before using sbt on ubuntu 14.04 and used the commands I needed, but

Why doesn't a custom resourceGenerator get executed upon compile?

半城伤御伤魂 提交于 2019-12-24 12:14:10
问题 I'm following the SBT docs on How to generate resources trying to get a resourceGenerator task in a plugin to run on compile. It's as simple as you see in the docs: object TestResourcePlugin extends AutoPlugin { import SbtWeb.autoImport._ import WebKeys._ override def requires = SbtWeb && plugins.JvmPlugin override def trigger = AllRequirements override def projectSettings = Seq( resourceGenerators in Compile += Def.task { val file = (resourceManaged in Compile).value / "demo" / "test" val

How to use '%%%' in a Build.scala file

二次信任 提交于 2019-12-24 12:13:40
问题 I'm getting familiar with using the '%%%' operator in a build.sbt file, but I don't understand how to use it in a build.scala file. I'm getting the following error: value %%% is not a member of String I'm guessing that I have to import the %%% somehow but I don't see how. I tried the following: import org.scalajs.sbtplugin.ScalaJSPlugin._ import ScalaJSKeys._ 回答1: Edit: Since Scala.js 0.6.23, you need the following import: import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport

Unresolved Dependencies in SBT Multi Project

冷暖自知 提交于 2019-12-24 12:12:12
问题 Using sbt 13.8, the newest scala plugin for IntelliJ, and a new SBT project with Scala 2.11.7, I try to add a single library - akka 2.4.2. following this, i simply add libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.4.2" But I am getting an unresolved dependency error: Error:Error while importing SBT project: [info] Resolving org.scala-sbt#tasks;0.13.8 ... [info] Resolving org.scala-sbt#tracking;0.13.8 ... [info] Resolving org.scala-sbt#cache;0.13.8 ... [info] Resolving org

Running Spark application: java.lang.NoSuchMethod error

我们两清 提交于 2019-12-24 12:03:55
问题 I have a Spark application that was assembled using sbt 0.13.7, Scala 2.11.4, and Spark 1.2.0. I am running on Mac OSX Yosemite. In build.sbt , I use "provided" for the Spark dependencies. I can run the application fine within sbt. I run into problems when I try to run it from the command line. Here is the command I use: ADD_JARS=analysis/target/scala-2.11/dtex-analysis_2.11-0.1.jar scala -cp /Applications/spark-1.2.0-bin-hadoop2.4/lib/spark-assembly-1.2.0-hadoop2.4.0.jar:analysis/target

Folders/packages in sbt ./project folder

≡放荡痞女 提交于 2019-12-24 11:01:41
问题 Looks strange to me, maybe i'm doing something wrong, but when i'm trying to launch sbt it can't find/compile files from folders/packages inside ./project folder, like: root/ project/ deploy/DeployModule.scala DeployConfig.scala Build.scala SBT can't resolve by build.deploy.DeployModule._ import, but if i move files from deploy folder into project folder it works. So it looks like SBT can't resolve files in nested folders inside project folder? 回答1: Sbt's meta build uses the default sbt build

Deploying Akka HTTP to Azure

一世执手 提交于 2019-12-24 10:53:11
问题 I was looking for some info on how to deploy Akka Http app to Azure. Azure supports Java Web Apps, but I assume it does only for apps that run in TomCat or alike. But Akka Http is a standalone application - is there any support for that and in any case, how should I proceed with it? I am aware of sbt-native-packager that can produce various installable formats, but seeing how easy it is to deploy .NET app from Visual Studio, I would love to see a simpler way for Java as well. 回答1: Based on my

sbt-buildinfo generated object cannot be referenced

纵然是瞬间 提交于 2019-12-24 09:48:09
问题 I'm using the aforementioned sbt plugin to get the version of the app I'm working on. The project has sub-modules. Here is the main build.sbt ... lazy val abandon = (project in file(".")). aggregate(base, cli, gui). dependsOn(base, cli, gui). enablePlugins(BuildInfoPlugin). settings(commonSettings: _*). settings( name := "abandon", fork in run := true, buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion), buildInfoPackage := "co.uproot.abandon" ) lazy val base =

Proxy settings for SBT from IntelliJ

久未见 提交于 2019-12-24 08:52:19
问题 I am trying to use Scala/Spark from IntelliJ in Windows 7, but it IntelliJ (and SBT command line) fails to download files. I am behind a proxy server. [info] Updating {file:/D:/Users/user1/IdeaProjects/untitled17/project/}untitled17-build... [warn] [FAILED ] org.apache.logging.log4j#log4j-core;2.8.1!log4j-core.jar(test-jar): typesafe-ivy-releases: unable to get resource for org.apache.logging.log4j#log4j-core;2.8.1: res=https://repo.typesafe.com/typesafe/ivy-releases/org.apache.logging.log4j