Scala 2.12 or 2.13
quick version (sbt)
Global / resolvers += "scala-integration" at "https://scala-ci.typesafe.com/artifactory/scala-integration/" scalaVersion := "2.13.9-bin-abcd123"
for a 2.12 nightly, substitute e.g.
2.13.9; in either case, it's the version number of the next release on that branch
abcd123, manually substitute the first 7 characters of the SHA of the latest green build on the 2.13.x or 2.12.x branch on Travis-CI.
A quick way to find out the full version number of a current nightly is to use
scala-cli, as follows.
quick version (scala-cli)
on scala-cli 0.1.3 or newer, you can run nightlies with:
scala-cli repl -S 2.12.nightly scala-cli repl -S 2.13.nightly scala-cli repl -S 2.nightly # same as 2.13.nightly # Scala 3, too! scala-cli repl -S 3.0.nightly scala-cli repl -S 3.1.nightly scala-cli repl -S 3.2.nightly scala-cli repl -S 3.nightly # same as 3.2.nightly at present
Of course, not only
repl works but also all the other scala-cli subcommands such as
run. It also works with
//> directives in your script itself, for example:
//> using scala "3.nightly"
The Scala team no longer publishes
-SNAPSHOT versions of Scala. (Starting that again could be a community contribution; see this ticket.)
But the team does publish nightly builds, each with its own fixed version number. The version number of a nightly looks like e.g.
-bin- signals binary compatibility to sbt; all 2.13.x releases since 2.13.0 are binary compatible with each other.)
The old Jenkins-based answer that used to be here no longer works, since we (in 2018) moved publishing of nightlies off Jenkins and onto Travis-CI.
To tell sbt to use one of these nightlies, you need to do three things.
First, add the resolver where the nightlies are kept:
Global / resolvers += "scala-integration" at "https://scala-ci.typesafe.com/artifactory/scala-integration/"
Second, specify the Scala version:
scalaVersion := "2.13.1-bin-abcd123"
But that isn't a real version number. Manually substitute a version number containing the 7-character SHA of the last commit in the scala/scala repository for which a nightly build was published. Look at https://travis-ci.org/scala/scala/branches and you'll see the SHA in the upper right corner of the 2.13.x (or 2.12.x) section. For example:
As soon as 2.13.1 is released, the version number in the nightly will bump to 2.13.2, and so on.
If you have a multiproject build, be sure you set these settings across all projects when you modify your build definition. Or, you may set them temporarily in the sbt shell with
++2.13.1-bin-abcd123 (sbt 0.13.x) or
++2.13.1-bin-abcd123! (sbt 1.x; the added exclamation point is necessary to force a version not included in
crossScalaVersions to be used).
Ideally, we would suggest an automated way to ask Travis-CI for the right SHA. This is presumably possible via Travis-CI's API, but (to my knowledge) nobody has looked into it yet. (Is there a volunteer?)
Note that we call these “nightly” builds informally, but technically it's a misnomer. A so-called “nightly” is built for every merged PR.
No further 2.11.x releases are planned, so we (the Scala team at Lightbend) aren't publishing 2.11 nightlies anymore, either.
- How do I tell sbt or scala-cli to use a nightly build of Scala 2.12 or 2.13?
- How do I tell sbt to use a nightly build of Scala 2.10?
- How do I tell sbt to use local scala installation?
- How to use MySQL JDBC driver in an SBT Scala project?
- What's the relationship of the versions of scala when I use sbt to build a scala project?
- How to use scala 2.10 trunk with sbt 0.11.0? (Unresolved dependencies)
- How do I make sbt use the scala binaries from $SCALA_HOME directory?
- How do I build multiple jar files using scala sbt
- How to use JSR-223 to get Scala interpreter in sbt console?
- How do I use nightly builds of Scala 2.9 with maven?
- How to use SBT IntegrationTest configuration from Scala objects
- How to get Intellij to use dependencies from SBT scala
- How to speed up sbt scala build in docker?
- How to build an scala sbt project as Android library?
- How do I tell Scala to use the right Java constructor?
- How to use JavaCV from SBT (Simple Build Tool) in Scala?
- How to configure SBT to use Scala 2.8?
- How to use sbt to specify dependsOn other module with different scala version?
- How do I set the Scala compiler to use a plugin when I build using Maven?
- Scala code compiles through command-line sbt but fails when compiled through Intellij Idea - how set up Intellij to use external sbt?
- How to get Unit Test counts in SonarQube for a Scala SBT build
- How to use gradle and IntelliJ to build a scala project?
- How to create an Object in my sbt build so I can use in my application?
- How can I build in sbt with an unreleased version of the Scala standard library?
- How can I use scala sources from a different location in a sbt project and also make it work with IntelliJ IDEA?
- How to use sbt-android to build scala android projects with RenderScript files?
- how use import a scala project created with sbt in eclipse?
- How to remove scala version from an sbt multi project with cross build on a particular project
- Is it possible to use butterknife with scala sbt build tool?
- How to build a jar file out of github project in sbt to be used in a scala program
More Query from same tag
- Scala Iterator with Map and For
- Comparing Lists with scalatest
- sbt.librarymanagement.ResolveException: Error downloading org.apache.spark:spark-core:3.0.1
- Write dataframe from spark cluster to cassandra cluster: Partitioning and Performance Tuning
- Scala MergeSort
- What is best supported wrapper for Memcache with Scala
- Scala: existential types for a Map
- 'case' keyword appearing without its corresponding 'match' keyword
- NoSuchElementException with existing key
- Apache Flink Kakfa XML stream
- libGDX how to set game room size?
- Extract host name from URL using scala
- Scala inner class generic bounds
- Scala: Using representation types
- Simple Java/Scala file copy that takes buffer/buffer size as parameter
- How do I call this maptree function in Scala?
- Type mismatch found: scala function => Unit required: java.util.Consumer
- Finatra TooLongMessageException HTTP content length exceeded 5242880 bytes, despite flag setting more bytes
- KeeperErrorCode = NoNode for /brokers/topics/test-topic/partitions
- In scala, how to turn object's values into Map[String, String]?
- Scala - Iterator over all the lines in the files in a directory
- Monad transformer for Future[Either[Error, Option[User]]]
- After update getting "Ambiguous implicit values" Error
- CreatePairedStream is not a member of MQTTUtils
- Scala - Constructs map from two lists at initialization
- Scala REPL from cmd: The syntax of the command is incorrect
- How to stop assembled Scalatra application?
- glClearColor display ony a black screen
- How do I extract a Future[String] from an akka Source[ByteString, _]?