2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

sbtでjarファイル作成

2
Posted at

https://github.com/sbt/sbt-assembly
を参考にsbt設定を追加する

// project/plugins.sbt
resolvers += Resolver.url("artifactory", url("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.8.4")


//build.sbt
import AssemblyKeys._ // put this at the top of the file

assemblySettings

//メインクラスを明示的に指定
mainClass in assembly := Some("com.example.Main")
# target以下にjarファイル作成
$ sbt
> assembly

# jarファイルの実行
$ java -jar target/jar-file.jar
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?