sbt

How do I get “sbt hello, world” to run?

对着背影说爱祢 提交于 2019-12-21 20:03:28
问题 I'm trying to get a clue about Scala/SBT and was walking through http://www.scala-sbt.org/0.13/docs/Hello.html The first step went well...I've got a directory called "hello" that has the result of $ sbt new sbt/scala-seed.g8 in it. At the 2nd step, "Running your app", the wheels come off. $ sbt [info] Loading project definition from /Users/robert.kuhar/dev/Hello/project [info] Set current project to Hello (in build file:/Users/robert.kuhar/dev/Hello/) > run [info] Compiling 1 Scala source to

sbt-assembly include test classes

喜你入骨 提交于 2019-12-21 19:59:55
问题 I follow sbt-assembly : including test classes from a config described in https://github.com/sbt/sbt-assembly that work ok doing assembly When I load sbt I get assembly.sbt:5: error: reference to jarName is ambiguous; it is imported twice in the same scope by import sbtassembly.AssemblyKeys._ and import _root_.sbtassembly.AssemblyPlugin.autoImport._ jarName in (Test, assembly) := s"${name.value}-test-${version.value}.jar" ^ So, I comment import line and run sbt:assembly but that begin the

Typesafe Config in Spark

蓝咒 提交于 2019-12-21 17:42:06
问题 I've defined a default configuration in my Spark application which is tucked in src/main/resources/reference.conf . I use ConfigFactory.load() to obtain the configuration. When I run the application with spark-submit it picks up these defaults. However, when I only want to override a few of the configurations available in reference.conf and provide application.conf , it does not seem to pick up these overrides. From the documentation I thought that application.conf is merged with reference

SBT Publish to Visual Studio Team Services (Web) Packages Plugin Repo

拟墨画扇 提交于 2019-12-21 17:05:43
问题 I'm trying to use SBT powered projects with Visual Studio Team Services, specifically the Packages plugin. The packages plugin has explicit instructions for how to get it to work with Maven, but I haven't been able to determine a means to adapt the instructions for SBT as they seem to rely on a configuration-powered hack of the Maven HTTP interface. The specific instructions I have are: Add credentials to your user settings.xml inside the <servers> tag <server> <id>projectspace-visualstudio

Automatically inject WebJarAssets in Play 2.5 HTML template?

☆樱花仙子☆ 提交于 2019-12-21 14:07:09
问题 In my Play HTML template inside my custom module, I have the following line of code: <script type="text/javascript" src="@controllers.core.routes.WebJarAssets.at(WebJarAssets.locate("jquery.min.js"))"></script> This references a WebJarAssets class in the core module that looks like this: package controllers.core import javax.inject._ import play.api.http.HttpErrorHandler import play.api.{Environment, Configuration} class WebJarAssets @Inject()(errorHandler: HttpErrorHandler, configuration:

How to build, compile and run a Scala project?

耗尽温柔 提交于 2019-12-21 13:03:21
问题 I would like to evaluate a Scala project that I have found on Github, namely TRank. I found the build file build.sbt . I managed to install Scala and sbt via homebrew and then run the command sbt run on the project root folder. Doing so ended up with an error: java.lang.RuntimeException: No main class detected. at scala.sys.package$.error(package.scala:27) Now the project files are in the src/main/scala/io/mem0r1es/trank and when I try to compile via scalac or run sbt run there I get a bunch

Multi-version build with SBT

谁都会走 提交于 2019-12-21 11:04:21
问题 I want to implement the following build in SBT: Having multiple scala version Having multiple target version (because of a library dependency) Let's take for example an external Lib, that exist in version 1.0, 2.0, 3.0, and Scala 2.92, 2.10.2, I would like to compile, assembly and publish: MyProject_externalLib1.0_scala_2.9.2 MyProject_externalLib1.0_scala_2.10.2 MyProject_externalLib2.0_scala_2.9.2 MyProject_externalLib2.0_scala_2.10.2 MyProject_externalLib3.0_scala_2.9.2 MyProject

IntelliJ, Akka and Configuration files

江枫思渺然 提交于 2019-12-21 09:16:28
问题 When using akka, I place akka.conf in src/main/resources . When I run through sbt, the akka.conf is correctly recognized. But not when I run through IntelliJ (even after a gen-idea ). What is the appropriate way to accomplish this? 回答1: Put the .conf extension in Settings ( Preferences on Mac) | Compiler | Resource Patterns . 来源: https://stackoverflow.com/questions/9333093/intellij-akka-and-configuration-files

sbt assembly shading to create fat jar to run on spark

偶尔善良 提交于 2019-12-21 07:39:14
问题 I'm using sbt assembly to create a fat jar which can run on spark. Have dependencies on grpc-netty . Guava version on spark is older than the one required by grpc-netty and I run into this error: java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument. I was able to resolve this by setting userClassPathFirst to true on spark, but leads to other errors. Correct me if I am wrong, but from what I understand, I shouldn't have to set userClassPathFirst to true if I do

How to stop Intellij from creating src/main/java and src/main/scala-x folders?

会有一股神秘感。 提交于 2019-12-21 07:08:58
问题 I have a SBT project in Intellij 15.0.2 for scala only programming. For some reason, the project keeps creating the following folders in my project: src/main/java src/main/scala-2.10 src/main/scala-2.11 src/test/java src/test/scala-2.10 src/test/scala-2.11 I have attempted to remove them by unchecking them as "Sources" or "Tests" in my Project Structure and then deleting the folders. But they are immediately re-created by Intellij ... 回答1: You can disable this while creating/importing sbt