SBT: Start a command line ‘run’ of the main class of a non-default project
You simply have to quote each command (as in the second example on this page), so in your case it would be: $ sbt “project foo” “run arg1 arg2”
You simply have to quote each command (as in the second example on this page), so in your case it would be: $ sbt “project foo” “run arg1 arg2”
I solved the sync issue following info here: https://youtrack.jetbrains.com/issue/SCL-13024 Key info is “It seems that sbt is trying to re-resolve ‘sources’ and ‘docs’ for sbt plugins that are not available at all. If properties to download “Library sources” and “sbt sources” are disabled, then time to dump the structure is reduced from ‘forever’ to less … Read more
You can put the jar in your project’s lib folder (create it if it doesn’t exist), it will then appear on your project’s unmanaged-classpath. To publish a jar file locally, if you have an sbt project that produces the jar, it should be as simple as invoking “publish-local” to publish the jar to your local … Read more
Using javacOptions ++= Seq(“-source”, “1.7”, “-target”, “1.7”) does not work if you have no Java sources. But you can set the target JVM for the Scala compiler in build.sbt or Build.scala: scalacOptions += “-target:jvm-1.7” As a result it prints on a JDK 6: $ sbt clean run [info] Set current project to default-cd5534 (in build … Read more
Step 1: Follow the instructions at Detailed Topics: Proxy Repositories, which I have summarised and added to below: (If you are using Artifactory, you can skip this step.) Create an entirely separate Maven proxy repository (or group) on your corporate Maven repository, to proxy ivy-style repositories such as these two important ones: http://repo.typesafe.com/typesafe/ivy-releases/ http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/ This … Read more
Just add this line in the build.scala or build.sbt file resolvers += Resolver.mavenLocal
The main Class must be fully qualified with the package: Compile/mainClass := Some(“myPackage.aMainClass”) This will work for run and it will set the Main-Class in the Manifest when using the package task. The main class for these tasks can be set separately as in: mainClass in (Compile, run) := Some(“myPackage.aMainClass”) mainClass in (Compile, packageBin) := … Read more
I use HomeBrew to install sbt on OS X. It supports a SBT_OPTS argument which can be put in ~/.sbtconfig file with export SBT_OPTS=-XX:MaxPermSize=256M.
The approach with multi-project build is the correct one. You can have a nested tree of subprojects of arbitrary length, but you cannot have a module belonging to multiple parent projects. This makes absolutely sense, and in Maven happens the same. The reason is that it would be hard to have the same module into … Read more
You need to put your application’s source in src/main/scala/, project/ is for build definition code.