sbt

How can I find duplicate classes amongst dependencies with SBT [closed]

删除回忆录丶 提交于 2020-01-03 15:30:54
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I'm migrating a project from Apache Maven to sbt. My project has lots of dependencies (over 200), and sometimes, a class can be duplicated that can lead to strange effects. In Maven I've been using maven-duplicate-finder-plugin for detecting such cases. The only solution I can see is to generate a big jar with

SBT cannot append Seq[Object] to Seq[ModuleID]

左心房为你撑大大i 提交于 2020-01-03 13:30:10
问题 SBT keeps failing with improper append errors. Im using the exact format of build files I have seen numerous times. build.sbt: lazy val backend = (project in file("backend")).settings( name := "backend", libraryDependencies ++= (Dependencies.backend) ).dependsOn(api).aggregate(api) dependencies.scala: import sbt._ object Dependencies { lazy val backend = common ++ metrics val common = Seq( "com.typesafe.akka" %% "akka-actor" % Version.akka, "com.typesafe.akka" %% "akka-cluster" % Version.akka

How to create a task that prints command line arguments?

本秂侑毒 提交于 2020-01-03 11:57:52
问题 I'm finding the documentation at http://www.scala-sbt.org/0.13/docs/Input-Tasks.html utterly baffling. Can someone provide me with a complete example of a task/input task that takes a command line argument and does something with it e.g.: sbt "greeting hello world" and prints "hello world" 回答1: Following the document Input Tasks (with the main change to the name of the input task so it's greeting ): import sbt.complete.Parsers.spaceDelimited val greeting = inputKey[Unit]("A demo input task.")

Setting up Akka with Eclipse

醉酒当歌 提交于 2020-01-03 10:56:30
问题 I am trying to get a simple Akka program building with Eclipse and Scala. I used g8 to create the sbt project with Akka(g8 typesafehub/akka-scala-sbt) and then sbteclispe to create the Eclipse project. When I import the project into Eclipse I'm given errors saying I am missing Akka. Is there any way that I can build an Akka project with Eclipse? 回答1: The simplest thing is to add the sbteclipse plugin to your Sbt build. It automatically generates project files for Eclipse, so that you can

How to execute SBT plugin's tasks from within IntelliJ IDEA CE?

吃可爱长大的小学妹 提交于 2020-01-03 08:36:40
问题 I use IntelliJ IDEA 13.1 Community Edition with the Scala plugin 0.32.593 . What's the recommended way to execute a SBT plugin's tasks, say dependencyUpdates from sbt-updates? 回答1: In version 15 of IntelliJ IDEA, using Scala Plugin version 2.0 , you can run SBT tasks by adding a run configuration. First add a new run configuration by clicking on Run -> Edit Configurations . Then click the + button to add a new configuration and choose SBT Task form the list Now provide the list of tasks

Pass JVM arguments to JMH

若如初见. 提交于 2020-01-03 07:26:48
问题 I have some JMH benchmarks that I'm trying to analyze. I want to enable GC logging to see how much garbage is being generated, but I can't figure out how to pass JVM arguments. I know JMH runs benchmarks in a forked JVM, so it's not immediately obvious to me how to do this. I'm using SBT. 回答1: If I read sbt-jmh docs right, it passes the application options to JMH runner with jmh:run ... . So, having that JMH command line accepts --jvmArgs "..." , I would try to do jmh:run --jvmArgs "-XX:

IntelliJ: Command Line is too Long. Shorten command line for… in SBT project

亡梦爱人 提交于 2020-01-03 03:14:10
问题 When I try to run my app, IntelliJ has just started to tell me "Command Line is too Long. Shorten command line for my_app or also for Application default configuration." the my_app is a blue link which leads to an "Edit Configuration" window, automatically selecting and highlighting a dropdown for class path shortener. I select the suggested options, but no change. I have no idea what this means - I'm using Scala, so I'm using a simple object MyObj extends App which takes no parameters at all

What is the recommended way to set JVM options for the executables created with sbt-native-packager?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-03 02:36:04
问题 Currently, I use export JAVA_OPTS ... on the command line, but there seem to be other possibilities, using the build.sbt or an external property file. I have found several relevant github issues here, here and here but the many options are confusing. Is there a recommended approach? 回答1: The approach you take to setting JVM options depends mainly on your use case: Inject options every time If you want to be able to specify the options every time you run your service, the two mechanisms are

PlayRunHook does not work in multi module projects

给你一囗甜甜゛ 提交于 2020-01-03 02:24:35
问题 We need a base play framework projects which contains other play and scala projects as module. Those inner independent projects can have different javascript frameworks and build system like webpack, gulp, etc. So I tried the PlayRunHook from https://www.playframework.com/documentation/2.4.x/SBTCookbook . Single project hooking working as expected. But, unable to get it right on multi module project. Some code samples... Project Structure base/build.sbt name := """base""" version := "1.0

Different scalac options for different scopes or tasks?

十年热恋 提交于 2020-01-02 23:13:10
问题 I am trying to use a compiler plugin with sbt (I'm on 0.13.5), passed along in my build.sbt as: autoCompilerPlugins := true scalacOptions += "-Xplugin:myCompilerPluginJar.jar" This works, the plugin runs, however I would really like to only run the plugin on some explicit compiles (perhaps with a scoped compile task or a custom task). If I try something like: val PluginConfig = config("plugin-config") extend(Compile) autoCompilerPlugins := true scalacOptions in PluginConfig += "-Xplugin