score:91
We're using Maven to build Scala projects at work because it integrates well with our CI server. We could just run a shell script to kick off a build, of course, but we've got a bunch of other information coming out of Maven that we want to go into CI. That's about the only reason I can think of to use Maven for a Scala project.
Otherwise, just use SBT. You get access to the same dependencies (really the best part about maven, IMHO). You also get the incremental compilation, which is huge. The ability to start up a shell inside of your project, which is also great.
ScalaMock only works with SBT, and you're probably going to want to use that rather than a Java mocking library. On top of that, it's much easier to extend SBT since you can write full scala code in the build file, so you don't have to go through all the rigamarole of writing a Mojo.
In short, just use SBT unless you really need tight integration into your CI server.
score:21
The question is in danger of just generating lots of opinions; it would be better to have a clear list of requirements or a description of your environment, previous knowledge, etc.
FWIW, there are more opinions in this scala mailing list thread.
My 2c are: Go with sbt if you don't have specific requirements
- for simple projects, it's totally effortless (you don't even need a build file until you have dependencies)
- it is commonly used across Scala open source projects. You can easily learn about configuration by peeking into other people's projects. Plus many projects assume you use sbt and provide you with ready-made copy+paste instruction for adding them as a dependency to your project.
- if you use IntelliJ IDEA, it can be totally integrated. You can have IDEA use sbt to continuously compile your project, and vice versa you can use sbt to quickly generate IDEA projects. The last is extremely useful if you are in a 'snapshot' cycle with depending on other of your own libraries which are bumped from minor version to minor version -- just close the project, update the version in the build file, re-run the
gen-idea
task, and re-open the project: updates done. - comes ready with most tasks you will need (
compile
,test
,run
,doc
,publish-local
,console
) -- theconsole
is one of the best features. - some people highlight the feature that dependencies can be source repositories directly grabbed from GitHub. I haven't used this so can't comment here.
Some people hate sbt because it uses Ivy for dependency management (I can't comment on its pros and cons, but most of the time it is a non-issue), some people hate sbt because you specify the build file in terms of a Scala DSL instead of XML. Some people were disappointed that sbt's format changed from v0.7 to v0.10, but obviously, migration won't affect you if you start from scratch.
Source: stackoverflow.com
Related Query
- Pros and cons of using sbt vs maven in Scala project
- Run Integration test and Unit test using Maven in Scala project
- Unable to compile spring boot project with java and scala using maven
- Creating a jar file from Scala project without using Sbt or Maven
- How to create a jar using maven written in scala that can be added and used in other project
- Using SBT to manage projects that contain both Scala and Python
- Scala+IDEA: Pros and cons of sbt and fsc
- Packaging and Running Scala Spark Project with Maven
- How to synchronize Intellij and sbt builds for a scala project
- maven and lift using scala 2.8 : lift-mapper missing?
- How to develop and run spark scala from vscode using sbt or Metals
- Scala project using sbt throws NullPointerException
- Including Hyperic Sigar library within jar while using sbt assembly for Scala project
- Is there any consideration for maven project and sbt project and play framework to share one single repository?
- Using Maven's shade plugin from Scala and sbt
- SBT - Multi project merge strategy and build sbt structure when using assembly
- scala sbt test run setup and cleanup command once on multi project
- How to setup scala sbt project for nd4j and deeplearning4j
- can I just get Scala REPL without creating a project using sbt
- How to run an existing Scala project using VS Code and Metals?
- Building a project with mixed Scala and Java source files using Ant - illegal cyclic reference error
- Building an SBT project using Maven
- IntelliJ IDEA : support both SBT and Maven on a single project
- What's the best way using Scala and SBT to create samples for a library that can be built from the SBT CLI?
- How to reaload scala application after code change using actors and sbt
- sbt using different Scala versions in a multi project build
- Running a Play! Project using the new sbt and jdk 9
- Require Java 8 to build Scala project using Maven
- Spark App using Scala and SBT in Eclipse
- transitive dependencies of scala project built with sbt within a different java maven project
More Query from same tag
- How to build a Spark (Scala) function to search documents for terms
- How is this type miss match?
- How to get a reference to the actor instance that runs a function?
- How to measure execution time of each loop step in Scala?
- PySpark UDF optimization challenge using a dictionary with regex's (Scala?)
- Return list of relations between pairs lists using scala
- Saving Scala SQL Output as DataFrame
- Logging while testing through Gradle
- What's the fundamental difference between those two constructs?
- Seeking a scala-esque approach to iterate through a list with access to the "next" element
- Why isn't SBT copying generated resources to the classes folder?
- Comparing user input character with a char in Scala
- Play sub-projects: how to convert to build.sbt
- spark submit java.lang.IllegalArgumentException: Can not create a Path from an empty string
- How IO monad makes concurrency easy to do in Scala?
- the filtering in Scala's for loop
- SBT - Multi project merge strategy and build sbt structure when using assembly
- Scala: iterate a sequence while modifying it?
- What is a "Maximal Sub-expression" in Scala 2.8 specification ยง6.26.5 Eta Expansion?
- How to set up sbt on Windows to select a specific JDK (among available JDKs)?
- Reading 100M rows from postgreSQL to Spark and writing to parquet
- using bit flag in play 2.0 using scala
- scala count strings in a list contained in a read file
- Why does SBT's Scala (2.10) not include Akka?
- How to ask for data from another actor which is not ready yet?
- Scala Traits and Inheritance
- object StreamingContext is not a member of package org.apache.spark [error] import org.apache.spark.StreamingContext
- Extract only first match with Regex in Scala
- How can I prevent an Scala function to receive 'null' as an argument
- Play Framework template doesn't have Html type