Configuring Jenkins plugin for SBT

As a logical next step of moving Specs2 Spring from Maven to SBT, I have now got Specs2 Spring building comfortably in our local Jenkins using the SBT goodness. The process was pretty straight forward!

First, I installed the sbt-plugin for Jenkins from the list of available plugins under Manage Plugin.

Manage plugin

Once the plugin installation completes and Jenkins is restarted, I verified that sbt-plugin is now available as one of the installed Jenkins plugins.

sbt-plging installed

Now that sbt-plugin is available on Jenkins, I had to configure a sbt launcher jar. I downloaded the very latest sbt launcher jar [0.11.2] from here, and saved it on our Jenkins build server. In order to complete the configuration, I had to specify the name and location of the sbt launcher jar under Jenkins configuration.

configure sbt plugin

Jenkins sbt plugin allows you to install multiple versions of sbt launcher jar files giving you the option of choosing the most appropriate one for your project.

All that remained now was to create a Jenkins build job which used sbt-launcher to build Spec2Spring. To do that I simply selected Build using sbt from Add build step.

add job step 1

Finally, I selected my preferred sbt launcher and specified the actions I wanted to run. And that was all I had to do!

add job step 2

-Dsbt.log.noformat=true sbt flag keeps the console output clean and tidy!

Note: To avoid frequent OutOfMemory errors, add something like the following JVM flags to your Jenkins build configuration (notice in particular the stack and perm gen size parameters):

-XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -Xmx512M -Xss16M

This entry was posted in Ani's Blog and tagged , , , , , . Bookmark the permalink.

One Response to Configuring Jenkins plugin for SBT

  1. Pingback: Configuring Jenkins plugin for SBT « Cake Solutions Team Blog | Scala frameworks and tools | Scoop.it

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>