sbt

How to add custom lines to MANIFEST.MF?

淺唱寂寞╮ 提交于 2020-01-02 05:15:09
问题 Adding custom key-value-pairs to the MANIFEST.MF using Build.scala seems not to work. Here is my code: import sbt._ import Keys._ import java.util.Date object Build extends Build { packageOptions in (Compile, packageBin) += Package.ManifestAttributes( "Build" -> "true" ) } When I add: packageOptions in (Compile, packageBin) += Package.ManifestAttributes( "Sign" -> "true" ) To my build.sbt then only Sign reaches my MANIFEST.MF. Any thoughts? 回答1: I think you may want something like this (note

SBT Unresolved Dependencies

被刻印的时光 ゝ 提交于 2020-01-02 05:06:22
问题 This is an SBT build file which I have written name := "Introduction" version := "1.0" scalaVersion := "2.11.2" resolvers ++= Seq( "snapshots" at "http://oss.sonatype.org/content/repositories/snapshots", "releases" at "http://oss.sonatype.org/content/repositories/releases" ) libraryDependencies ++= Seq("org.specs2" %% "specs2" % "1.12.3" % "test") when I run sbt compile I get error message [info] Resolving org.specs2#spec2_2.11;1.12.3 ... [warn] module not found: org.specs2#spec2_2.11;1.12.3

NoClassDefFoundError with sbt and scala.swing

你说的曾经没有我的故事 提交于 2020-01-02 04:54:05
问题 I'm new to JVM land so I apologize if this is a common problem. I'm using Scala (2.12) with sbt 0.13.13 on OSX. I'm working on a tiny app that depends on the GUI library scala.swing (2.10.x). I ran into a runtime issue almost immediately with example code (http://otfried.org/scala/index_28.html). Specifically, when invoking sbt run I get a stacktrace leading with: [error] (run-main-0) java.lang.NoClassDefFoundError: scala/Proxy$class java.lang.NoClassDefFoundError: scala/Proxy$class at scala

Set default env variable for test configuration in sbt

冷暖自知 提交于 2020-01-02 04:15:06
问题 In my app i have runtime config initialization based on SCALA_ENV variable In build.sbt i need to check if SCALA_ENV var is set, and if not set it to "test" but only for tests configuration, so that when sbt test is run locally on a developer machine without explicitly setting SCALA_ENV it would always use test environment configs I tried fork in test := true envVars in Test := Map("SCALA_ENV" -> "test") And then later somewhere in tests System.getenv("SCALA_ENV") But it always returns null..

how to write an sbt plugin to launch the app with an agent

南笙酒味 提交于 2020-01-02 04:00:27
问题 I would like to create an sbt plugin for my project before I open source it. The project attaches a Java agent to the start of running an application, to instrument it for various types of profiling. The agent writes out text files for later processing. I would like to be able to write an sbt plugin that can have an alternative to run called runWithProfiling which launches a new java process, with the agent added to the argument list, and passing all the users commands. on exit, I then want

On scala project - Getting error GC overhead limit exceeded when running sbt test command

僤鯓⒐⒋嵵緔 提交于 2020-01-02 02:33:51
问题 I'm new in scala programming and getting GC overhead limit exceeded error when I execute sbt test command in one of big scala project. Anyone knows how can I solve this? 回答1: I got help from my friends :) Increase the memory option by executing with -mem option for example: sbt -mem 2048 test Other options: For Mac & Linux user: if we need to execute this a lot. We can update the .bash_profile file and add below command: export SBT_OPTS="-Xmx2G" Other solution (works with Windows as well):

sbt web plugin: Not a valid key: jetty-run (similar: jetty-port, jetty-context, run)

泪湿孤枕 提交于 2020-01-02 02:32:10
问题 I'm trying to set up a scala sbt project with the lift web framework. I'm using scala 2.9.0-1 sbt 0.10.1 lift 2.3 xsbt-web-plugin 0.1.1 (which is only on scala 2.8.1, see end of question) (quite recent versions I know). I followed http://d.hatena.ne.jp/k4200/20110711/1310354698 and https://github.com/siasia/xsbt-web-plugin/blob/master/README.md to obtain the following sbt configuration files: project/build.properties sbt.version=0.10.1 project/plugins/build.sbt resolvers += "Web plugin repo"

How do you run cucumber with Scala 2.11 and sbt 0.13?

拈花ヽ惹草 提交于 2020-01-02 02:24:46
问题 Does anyone have an example of a cucumber project with sbt 0.13 and Scala 2.11? Do I need both the cucumber-scala_2.11 and the sbt-cucumber-plugin" % "0.8.0" (is that plugin up to date)? Where does the plugin go now? Where do the .feature files go? Where do the cucumber tests go? How do I run the tests from sbt? (optional) How can I run the tests from IntellJ (15)? 回答1: Ok, I figured out a solution with the following caveat: I'm not using sbt. Idea We will write cucumber features and steps

SLF4J: Class path contains multiple SLF4J bindings. message printed on console

自闭症网瘾萝莉.ら 提交于 2020-01-02 01:18:12
问题 I want to print logs on console and also write them in a file. In my scala project using akka loggers here is my build.sbt libraryDependencies ++= Seq("org.mongodb" %% "casbah" % "2.8.0", "org.slf4j" % "slf4j-simple" % "1.7.12", "org.elasticsearch" % "elasticsearch" % "1.5.0", "org.scalatest" %% "scalatest" % "2.2.1" % "test" withSources() withJavadoc(), "org.easymock" % "easymock" % "3.1" withSources() withJavadoc(), "org.mockito" % "mockito-all" % "1.9.5", "com.typesafe.akka" %% "akka-actor

SBT Scaladoc Configuration

给你一囗甜甜゛ 提交于 2020-01-02 01:10:14
问题 I'm trying to configure the Scaladoc in SBT, specifically the title, output directory and classpath. I managed to define the title by adding the following to build.sbt: scalacOptions in (Compile, doc) ++= Opts.doc.title("Scala-Tools") I can't figure out how to change the doc output directory. I also can't figure out how to add jars to classpath. The reason I want to edit the classpath is because it appears the standard Scala library is not getting picked up by scaladoc when I refer to its