How to set system properties for runMain on command line?

This works: sbt ‘; set javaOptions += “-Dconfig.resource=../application.conf” ; runMain akka.Main com.my.main.Actor’ If this isn’t a “friendly” enough syntax, wrap it in a little shell script. (Note this assumes you have fork set to true for running. If you don’t, see akauppi’s comment.)

How to access a secured Nexus with sbt?

Here’s what I did (sbt 0.13 + artifactory – setup should be similar for nexus): 1) Edited the file ~/.sbt/repositories as specified here: http://www.scala-sbt.org/0.13.0/docs/Detailed-Topics/Proxy-Repositories.html [repositories] local my-ivy-proxy-releases: http://repo.company.com/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext] my-maven-proxy-releases: http://repo.company.com/maven-releases/ 2) Locked down my artifactory to disable anonymous access. 3) Created a credentials file in ~/.sbt/.credentials realm=Artifactory Realm host=artifactory.mycompany.com user=username password=password 4) Created a … Read more

Create standalone jar using SBT

There is a difference between standalone and making a project useable as a dependency or another project. In the first case, you would use a plugin such as sbt-assembly. What it will do is create one jar file containing the project class files along with all of its dependencies. If you write an application, what … Read more

How to fix sbt reporting “Error wrapping InputStream in GZIPInputStream: java.io.EOFException”?

It appears that the exception has been due to some problems with the local repo. After cleanup, e.g. removing target directories from ~/.sbt directory it’s now working fine. jacek:~/.sbt $ find . -name target | xargs rm -rf jacek:~/sandbox/stackoverflow/testaaa $ sbt [info] Loading global plugins from /Users/jacek/.sbt/0.13/plugins [info] Updating {file:/Users/jacek/.sbt/0.13/plugins/}global-plugins… [info] Resolving org.fusesource.jansi#jansi;1.4 … [info] … Read more

How to publish jar to local repository?

The publishLocal action is used to publish your project to a local Ivy repository. By default, this local repository is in ${user.home}/.ivy2/local. You can then use this project from other projects on the same machine source EDIT: Sorry I misread your question. Here is an example to publish a jar or sources to your local … Read more

How to set main class in build?

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

How to use sbt from behind proxy?

sbt respects the usual environment variables for http proxy settings: export JAVA_OPTS=”$JAVA_OPTS -Dhttp.proxyHost=yourserver -Dhttp.proxyPort=8080 -Dhttp.proxyUser=username -Dhttp.proxyPassword=password” (That’s of course, assuming Unix (Linux/OSX etc). On windows you could just set the same environment variable (%JAVA_OPTS%) as usual in the Windows way.) Then run sbt as usual: sbt Switching between proxy/no-proxy should be a matter of setting … Read more

How can I check the SBT version?

sbt –version It now works as of version 1.3.3+ (credit to @ElectronWill). You may also want to use sbt about that (copying Mark Harrah’s comment): The about command was added recently to try to succinctly print the most relevant information, including the sbt version.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)