4

I am trying to bring SBT into my organization through a side door. We use TeamCity for our continuous integration system with all projects built using Maven. I am starting to prefer SBT for building Scala and mixed Scala/Java projects, but I will get resistance if I ask our infrastructure group to modify the continuous integration system to support SBT.

I am looking for a way to provide a minimal pom.xml file in the root of my project that then invokes SBT to do the actual build. Is there any way to do this, perhaps with a Maven-to-SBT plugin?

Ralph
  • 31,584
  • 38
  • 145
  • 282

1 Answers1

2

I'm not a fan of going against infrastructure since I perform a similar role at my current employment.

However what you could do is download the sbt-launch.jar and put it in a build directory in your Source Control Repository. Then create a sbt file inside that build folder with the following:

#!/bin/bash
SBT_OPTS="-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M"
java $SBT_OPTS -jar `dirname $0`/sbt-launch.jar "$@"

Then create a Command Line build step that does the following:

sh build/sbt clean compile

Which should give you what you want, this assumes however you have the ability to setup your own build steps that would run this custom script.

I haven't tested this and did it based off the sbt Setup Documentation

Hope it helps.

Welsh
  • 5,138
  • 3
  • 29
  • 43