Search code examples
scalaintellij-ideaapache-sparksbtintellij-14

Scala - IntelliJ: Simple Module w/ Scala SDK vs SBT-based


I am new to learning Scala and have enrolled in Martin Odersky's MOOC; Functional Programming Principles in Scala. I am doing so as a stepping stone to learning Apache Spark

The course usually demonstrates with Eclipse, but I would like to try IntelliJ. My question is simple I suspect. When creating a new project I am presented with two options for the project type:

  1. Simple Module with attached Scala SDK
  2. SBT-based Scala project

What are the major differences between these two types of projects? I suspect that the first option bundles the SDK with your project, while the second one downloads dependencies using SBT at compile time. Can you provide examples of when one would prefer to use one over the other?

Before downloading IntelliJ, I have been using sbt package and spark-submit.


Solution

  • The Simple Module with attached Scala SDK will create project where project structure will be captured in proprietary IntelliJ files. Scala SDK will be attached as a classpath dependency. The ultimate outcome is that you will be able to comfortably work with project only in IntelliJ.

    The SBT-based Scala project will create project using SBT which is Scala build system. Your project structure, dependencies will be captured in SBT configuration and IntelliJ project will be generated from this SBT configuration. Everyone who will get your project in this format will be able to work with it and will need only SBT.