sbt

error: eof expected?! How to use idea and eclipse plugins together in sbt?

痞子三分冷 提交于 2019-12-22 03:15:34
问题 I use sbt 0.13 . Both https://github.com/typesafehub/sbteclipse and https://github.com/typesafehub/sbt-idea suggest to add a line for each to ~/.sbt/plugins/build.sbt . Thus my plugins/build.sbt looks like: addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.5.1") addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.3.0") With that, sbt keeps failing with the error: .sbt/0.13/plugins/build.sbt:2: error: eof expected but ';' found. addSbtPlugin("com.typesafe.sbteclipse" %

Run sbt with -Ylog-classpath

微笑、不失礼 提交于 2019-12-22 02:31:16
问题 I got an error like this when I run 'sbt compile': missing or invalid dependency detected while loading class file 'DefaultReads.class'. [error] Could not access term time in package java, [error] because it (or its dependencies) are missing. Check your build definition for [error] missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.) How can I pass -Ylog-classpath to sbt? 回答1: -Y is just a scalac parameter. There are two types as per the doc

java.lang.NoClassDefFoundError: sbt/compiler/IC$Result

久未见 提交于 2019-12-22 01:35:06
问题 Hope someone can help me to get rid of this issue. When I add addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "1.0.0") to plugins.sbt then I get java.lang.NoClassDefFoundError: sbt/compiler/IC$Result plugins.sbt: logLevel := Level.Warn resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.4.3") addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "1.0.0") build.sbt: name := "HelloWorld" version := "1.0"

Organizing files in a SBT-based scala project

…衆ロ難τιáo~ 提交于 2019-12-22 00:35:49
问题 Newcomer to the Intellij IDE here, with no Java background. I've looked at Build Definition to get a brief idea on how should I organize my scala files, but their example doesn't cover the full structure of an SBT-based project shown attached. Can you advise what each folder should be used for (e.g. where my source files should go, etc.) and also point me to sources where I can go read up more. Thanks so much 回答1: It is described pretty well here: http://www.scala-sbt.org/0.13.5/docs/Getting

How to create custom “package” task to jar up only specific package in SBT?

时光怂恿深爱的人放手 提交于 2019-12-21 23:25:08
问题 I have a Play project running on Play 2.1.1 . I would like to define a separate and distinct task to jar up only a specific package in my Play project (e.g. just the models package). I do not wish to override the current package tasks as I want to preserve their behaviour. How would I go about creating a custom task based off of the current package task? I've looked at Custom Settings and Tasks in the SBT documentation but these examples are fairly trivial and don't give any examples that use

loading the right dependencies for sbt console in multi project setup causing derby security exception

眉间皱痕 提交于 2019-12-21 23:21:58
问题 I have a SBT multi project setup outlined https://github.com/geoHeil/sf-sbt-multiproject-dependency-problem and want to be able to execute sbt console in the root project. When executing: import org.apache.spark.sql.SparkSession val spark = SparkSession.builder().master("local[*]").enableHiveSupport.getOrCreate spark.sql("CREATE database foo") in the root console the error is: java.lang.NoClassDefFoundError: Could not initialize class org.apache.derby.jdbc.EmbeddedDriver Strangely, it works

Scala and sbt: Storing SQL in a resource

寵の児 提交于 2019-12-21 23:00:26
问题 I'd like to store a database schema in its own file, and have my Scala code retrieve it (and execute it via JDBC). It seems to me that sbt wants me to store the file as: src/main/resources/packagename/my.sql. Putting it there, I see it's in the jar - but I can't seem to access it from Scala. Specifically, getClass().getResource("my.sql") returns a null pointer, and so does any other form I can think of. How should I load the file? Or is there a better way to do it? 回答1: I had an almost

SBT: How to define dependencies of subprojects in subprojects' build.sbt files?

陌路散爱 提交于 2019-12-21 20:58:40
问题 The following build.sbt file works, but it defines the dependencies of all subprojects: name := "myproject" version := "1.0" scalaVersion := "2.11.8" libraryDependencies ++= Seq( "org.scalafx" %% "scalafx" % "8.0.60-R9" ) lazy val aLib = (project in file("lib/a")) lazy val bLib = (project in file("lib/b")) .dependsOn(aLib) .dependsOn(cLib) lazy val cLib = (project in file("lib/c")) .dependsOn(aLib) lazy val myApp = (project in file("myapp")) .dependsOn(aLib) .dependsOn(bLib) .dependsOn(cLib)

resolvers not shared to dependent sbt projects?

ⅰ亾dé卋堺 提交于 2019-12-21 20:53:09
问题 In this weird case that seems to involve xsbt-web-plugin, I get the error unresolved dependency: play#play-json_2.10;2.2-SNAPSHOT: not found when loading the server subproject. The dependency and the correct resolver are specified in the library subproject, which server depends on. It doesn't blow up if I don't include webSettings in server, but I am trying to build a .war there. [root]/project/Build.scala import sbt._ import Keys._ object MyBuild extends Build { lazy val root = Project("root

java.lang.NoSuchMethodError: akka.actor.ActorCell.addFunctionRef

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-21 20:30:05
问题 I am trying to setup a simple akka-http 2.4.2 project to test it out, but I am failing to do so. My built.sbt: import NativePackagerHelper._ lazy val akkaVersion = "2.4.2" lazy val root = (project in file(".")). settings( name := "akkTest", version := "0.1", scalaVersion := "2.11.7") libraryDependencies ++= Seq( "com.typesafe.akka" %% "akka-actor" % akkaVersion, "com.typesafe.akka" %% "akka-http-spray-json-experimental" % akkaVersion ) enablePlugins(JavaServerAppPackaging) my code snippet in