Skip to content


Subversion checkout URL

You can clone with
Download ZIP
sbt 0.12 plugin for generating and compiling thrift files
tag: 0.3

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

Thrift plugin for sbt 0.10+ and 0.11+

Instructions for use:

Step 1: Include the plugin in your build

Add the following to your project/plugins/build.sbt:


resolvers += "bigtoast-github" at ""

libraryDependencies += "atd" %% "sbt-thrift" % "0.3"


resolvers += "bigtoast-github" at ""

addSbtPlugin("atd" % "sbt-thrift" % "0.3")

Step 2: Add sbt-thrift settings to your build

Add the following to your 'build.sbt' ( if you are using build.sbt )

import atd.sbtthrift.ThriftPlugin

seq(ThriftPlugin.thriftSettings: _*)

Or if you are using a build object extending from Build:

import sbt._
import Keys._
import atd.sbtthrift.ThriftPlugin

class BuildWithThriftShiz extends Build {
     lazy val seniorProject = Project("hola", file("."), settings = 
      Defaults.defaultSettings ++ ThriftPlugin.thriftSettings ++ Seq(/* custom settings go here */))


thrift Thrift executable. This defaults to just 'thrift'
thrift := "/some/other/path/to/thrift"
thriftSourceDir Directory containing thrift sources. This defaults to 'src/main/thrift'.
thriftSourceDir <<= baseDirectory( _ / "other" / "thrift" / "sourceDir" )
thriftOutputDir The output dir for the generated sources. This directory will be added to sourceManaged so it will be automatically get compiled when you run compile. This defaults to 'target/generated-sources'.


thrift-generate-java This will run generate java sources from the thrift sources. This task is automatically executed when compile is run.

Warnings and Notes

This is my second sbt plugin. So far it has been used in development environments at work and in Jenkins builds. It is pretty straight forward and only generates java. If other languages are requested please let me know.

If any bugs are found or features wanted please file an issue in the github project. I will do my best to accommodate.


I used the following plugins as reference

  • my sbt-liquibase plugin
  • sbt-protobuf plugin for sbt 0.10
Something went wrong with that request. Please try again.