Surprising as it sounds, Eclipse doesn’t support sbt out of the box, not even in the Scala IDE. At least I wasn’t able to find a way of how to generate an sbt project from within Eclipse. Hence, I wrote my own bash script which generates a ready-to-use Eclipse-compliant minimalistic sbt project.

The script sbt-eclipse.sh (see below) has yet to be polished. However, it works and gets the job done.

sh ./sbt-eclipse.sh [project_name] [project_version] [scala_version] [sbt_version]

As you can see the script takes a bunch of arguments, all of which are optional. Default settings:

project name: sbt_eclipse_project
project version: 1.0
scala version: 2.11.7
sbt version: 0.13.9

sbt-eclipse.sh:

https://gist.github.com/zezutom/a10d3c52179963f4fecd

The script generates a project skeleton, adds the Eclipse plugin into the project configuration and finally builds it by running sbt eclipse.

Once the build finishes the project is ready to be imported into Eclipse (File > Import > Existing Projects into Workspace):

Project Explorer:

Happy coding and thanks for reading.

Categories: ScalaToolkit

Tomas Zezula

Hello! I'm a technology enthusiast with a knack for solving problems and a passion for making complex concepts accessible. My journey spans across software development, project management, and technical writing. I specialise in transforming rough sketches of ideas to fully launched products, all the while breaking down complex processes into understandable language. I believe a well-designed software development process is key to driving business growth. My focus as a leader and technical writer aims to bridge the tech-business divide, ensuring that intricate concepts are available and understandable to all. As a consultant, I'm eager to bring my versatile skills and extensive experience to help businesses navigate their software integration needs. Whether you're seeking bespoke software solutions, well-coordinated product launches, or easily digestible tech content, I'm here to make it happen. Ready to turn your vision into reality? Let's connect and explore the possibilities together.