Use SBT To Build Pure Java Project

opticyclic picture opticyclic · Nov 28, 2011 · Viewed 17.7k times · Source

Historically I have used Ant+Ivy or Maven for building my Java projects. I'm now looking at non-xml based solutions.

Gradle can compile, jar and publish my project with few issues.

Can I do the same with SBT? If so, can you provide a simple example of using sbt to build a java only project.

Answer

Hiery Nomus picture Hiery Nomus · Nov 28, 2011

Yes this is entirely possible. Nothing to setup really, a small build.sbt file should do the trick, something like:

organization := "your.group.id"

name := "Your project"

version := "1.0-SNAPSHOT"

libraryDependencies ++= Seq( <any normal jar deps> )

And run sbt package from the command line.