SBT

The interactive build tool

Install

$ wget https://github.com/sbt/sbt/releases/download/v1.1.0/sbt-1.1.0.tgz
$ sudo tar zxvf sbt-1.1.0.tgz -C /opt/
$ sudo vi /etc/profile.d/sbt.sh
export SBT_HOME=/opt/sbt
export PATH="$SBT_HOME/bin":"$PATH"
$ source /etc/profile

Red Hat Enterprise Linux and other RPM-based distributions

curl https://bintray.com/sbt/rpm/rpm | sudo tee /etc/yum.repos.d/bintray-sbt-rpm.repo
sudo yum install sbt
$ sbt about
[info] Updated file /home/vagrant/project/build.properties: set sbt.version to 1.1.0
[info] Loading project definition from /home/vagrant/project
[info] Updating ProjectRef(uri("file:/home/vagrant/project/"), "vagrant-build")...
[info] Done updating.
[info] Set current project to vagrant (in build file:/home/vagrant/)
[info] This is sbt 1.1.0
[info] The current project is ProjectRef(uri("file:/home/vagrant/"), "vagrant") 0.1.0-SNAPSHOT
[info] The current project is built against Scala 2.12.4
[info] Available Plugins: sbt.plugins.IvyPlugin, sbt.plugins.JvmPlugin, sbt.plugins.CorePlugin, sbt.plugins.JUnitXmlReportPlugin, sbt.plugins.Giter8TemplatePlugin
[info] sbt, sbt plugins, and build definitions are using Scala 2.12.4

Project build definition

의존 관계 설정
"<groupID>" % "<artifactID>" % "<version>" % "<configuration>"

build.sbt

name := "sbt"
version := "0.1"
scalaVersion := "2.11.12"

libraryDependencies ++= Seq(
  "org.apache.spark" %% "spark-core" % "2.2.1" % "provided",
  "joda-time" % "joda-time" % "2.8.2"
)

assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false)

project/plugins.sbt

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.6")
$ sbt assembly

Reference

  • sbt RefereceManual, https://www.scala-sbt.org/1.x/docs/Setup.html





© 2017. by yeopoong.github.io

Powered by yeopoong