Skip to content

Commit 69bb7c6

Browse files
committed
Update the nightlies doc to mention repo.scala-lang.org
1 parent 95cdef8 commit 69bb7c6

File tree

1 file changed

+105
-19
lines changed

1 file changed

+105
-19
lines changed

_overviews/core/nightlies.md

Lines changed: 105 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,57 +10,139 @@ Here's how to find and use these versions.
1010

1111
## Scala 3
1212

13-
Scala 3 nightly versions are published to Maven Central. If you know the full version number of the nightly you want to use, you can use it just like any other Scala 3 version.
13+
Scala 3 nightly versions are published to [https://repo.scala-lang.org](https://repo.scala-lang.org). Historically, they used to be published to Maven Central. Old nightly versions of Scala 3 (all the way until `3.8.0-RC1-bin-20250822-658c8bd-NIGHTLY` in August 2025) are still available there, as well as via [https://repo.scala-lang.org](https://repo.scala-lang.org).
1414

15-
One quick way to get that version number is to visit [https://dotty.epfl.ch](https://dotty.epfl.ch) and look in the upper left corner.
15+
If you know the full version number of the nightly you want to use, you can use it just like any other Scala 3 version.
1616

17-
Another way is to scrape Maven Central, as shown in this script: [https://raw.githubusercontent.com/VirtusLab/community-build3/master/scripts/lastVersionNightly.sc](https://raw.githubusercontent.com/VirtusLab/community-build3/master/scripts/lastVersionNightly.sc)
17+
There are a number of ways to get that version number, as listed below.
1818

19-
A third way is to use [scala-cli](https://scala-cli.virtuslab.org), as follows. (Since Scala 3.5.0, the `scala` command runs `scala-cli`.)
19+
### Scala CLI
2020

21-
### scala-cli
21+
Scala CLI is the official runner of the language and has nightlies available without any extra configuration. From Scala 3.5.0 and on it's available under the `scala` command in Scala 3 installations. It can also be installed separately as `scala-cli`.
22+
23+
Note: The new artifactory is supported since Scala CLI v1.9.0 onwards (or `scala` installed with Scala 3.7.3 or newer).
2224

2325
You can run nightlies with commands such as:
2426

25-
scala-cli -S 3.nightly
26-
scala-cli -S 3.3.nightly
27+
scala -e 'println("Hello") -S 3.nightly
28+
scala -e 'println("Hello") -S 3.3.nightly
2729

28-
The default command is `repl`, but all the other scala-cli subcommands such as `compile` and `run` work, too. It also works with `//>` directives in your script itself, for example:
30+
The default command is `repl` (unless sources are passed, in which case it switches to `run`), but all the other scala-cli subcommands such as `compile` and `run` work, too. It also works with `//> using` directives in your script itself, for example:
2931

3032
//> using scala 3.nightly
3133

3234
See this [scala-cli doc page](https://scala-cli.virtuslab.org/docs/commands/compile#scala-nightlies) for details.
3335

36+
### Get it from the nightly website
37+
38+
A quick way to get that version number is to visit [https://nightly.scala-lang.org](https://nightly.scala-lang.org) and look in the upper left corner.
39+
40+
### Check the artifactory, directly
41+
42+
Another way is to scrape the artifactory, as shown in this script: [https://raw.githubusercontent.com/VirtusLab/community-build3/master/scripts/lastVersionNightly.sc](https://raw.githubusercontent.com/VirtusLab/community-build3/master/scripts/lastVersionNightly.sc)
43+
44+
A third way is to use [scala-cli](https://scala-cli.virtuslab.org), as follows.
45+
46+
### SBT
47+
48+
To use recent nightlies with SBT, adding the appropriate resolver to the build configuration is necessary.
49+
50+
ThisBuild / scalaVersion := "3.8.0-RC1-bin-20250916-eb1bb73-NIGHTLY"
51+
ThisBuild / resolvers += Resolver.scalaNightlyRepository
52+
lazy val root = (project in file("."))
53+
.settings(name := "sbt-with-scala3-nightlies")
54+
55+
Note that for older nightlies (3.8.0-RC1-bin-20250822-658c8bd-NIGHTLY and before) no such change is necessary, as they were being published to Maven Central.
56+
57+
Also note that SBT 1.11.5 or newer is necessary.
58+
59+
### Mill
60+
61+
To use recent nightlies with Mill, a custom resolver for the initial bootstrap of the build is needed.
62+
Here's an example `build.mill` file:
63+
64+
package build
65+
import mill.*
66+
import mill.api.*
67+
import scalalib.*
68+
69+
def scala3NightlyRepo = "https://repo.scala-lang.org/artifactory/maven-nightlies"
70+
71+
object project extends ScalaModule {
72+
def jvmWorker = ModuleRef(CustomJvmWorkerModule)
73+
override def scalaVersion = "3.8.0-RC1-bin-20250916-eb1bb73-NIGHTLY"
74+
override def repositories = Task { super.repositories() ++ Seq(scala3NightlyRepo)}
75+
}
76+
77+
object CustomJvmWorkerModule extends JvmWorkerModule, CoursierModule {
78+
override def repositories = Task { super.repositories() ++ Seq(scala3NightlyRepo)}
79+
}
80+
81+
Note how the custom `JvmWorkerModule` is necessary with the added repository. It is not enough to just define it as a repository for the module dependencies.
82+
83+
Also note that Mill 1.0.5 or newer is necessary for this.
84+
3485
## Scala 2.13 or 2.12
3586

3687
We informally refer to Scala 2 “nightly” versions, but technically it's a misnomer. A so-called “nightly” is built for every merged PR.
3788

3889
Scala 2 nightly versions are published to a special resolver. Unless you are using scala-cli, you'll need to add that resolver to your build configuration in order to use these versions.
3990

40-
### quick version (sbt)
91+
### SBT
4192

42-
Global / resolvers += "scala-integration" at
43-
"https://scala-ci.typesafe.com/artifactory/scala-integration/"
44-
scalaVersion := "2.13.15-bin-abcd123"
93+
ThisBuild / scalaVersion := "2.13.15-bin-abcd123"
94+
ThisBuild / resolvers += Resolver.scalaNightlyRepository
95+
lazy val root = (project in file("."))
96+
.settings(name := "sbt-with-scala2-nightlies")
4597

4698
For a 2.12 nightly, substitute e.g. `2.12.20` for `2.13.15`; in either case, it's the version number of the _next_ release on that branch.
4799

48100
For `abcd123`, substitute the first 7 characters of the SHA of the latest commit to the [2.13.x branch](https://github.com/scala/scala/commits/2.13.x) or [2.12.x branch](https://github.com/scala/scala/commits/2.12.x) that has a green checkmark. (Clicking the checkmark will show a CI job name with the whole version in its name.)
49101

50102
A quick way to find out the full version number of a current nightly is to use [scala-cli](https://scala-cli.virtuslab.org), as follows.
51103

52-
### quick version (scala-cli)
104+
### Scala CLI
53105

54-
You can run nightlies with:
106+
Scala CLI is the official runner of the language and has nightlies available without any extra configuration. From Scala 3.5.0 and on it's available under the `scala` command in Scala 3 installations. It can also be installed separately as `scala-cli`.
55107

56-
scala-cli -S 2.13.nightly
57-
scala-cli -S 2.nightly # same as 2.13.nightly
58-
scala-cli -S 2.12.nightly
108+
Note: The new artifactory is supported since Scala CLI v1.9.0 onwards (or `scala` installed with Scala 3.7.3 or newer).
109+
110+
You can run nightlies with commands such as:
59111

60-
The default command is `repl`, but all the other scala-cli subcommands such as `compile` and `run` work, too. It also works with `//>` directives in your script itself, for example:
112+
scala-cli -e 'println("Hello") -S 2.13.nightly
113+
scala-cli -e 'println("Hello") -S 2.nightly # same as 2.13.nightly
114+
scala-cli -e 'println("Hello") -S 2.12.nightly
115+
116+
The default command is `repl` (unless sources are passed, in which case it switches to `run`), but all the other scala-cli subcommands such as `compile` and `run` work, too. It also works with `//> using` directives in your script itself, for example:
61117

62118
//> using scala 2.nightly
63119

120+
See this [scala-cli doc page](https://scala-cli.virtuslab.org/docs/commands/compile#scala-nightlies) for details.
121+
122+
### Mill
123+
124+
To use recent nightlies with Mill, a custom resolver for the initial bootstrap of the build is needed.
125+
Here's an example `build.mill` file:
126+
127+
package build
128+
import mill.*
129+
import mill.api.*
130+
import scalalib.*
131+
132+
def scalaNightlyRepo = "https://repo.scala-lang.org/artifactory/maven-nightlies"
133+
134+
object project extends ScalaModule {
135+
def jvmWorker = ModuleRef(CustomJvmWorkerModule)
136+
override def scalaVersion = "2.13.17-bin-8b9ec50"
137+
override def repositories = Task { super.repositories() ++ Seq(scalaNightlyRepo)}
138+
}
139+
140+
object CustomJvmWorkerModule extends JvmWorkerModule, CoursierModule {
141+
override def repositories = Task { super.repositories() ++ Seq(scalaNightlyRepo)}
142+
}
143+
144+
Note how the custom `JvmWorkerModule` is necessary with the added repository. It is not enough to just define it as a repository for the module dependencies.
145+
64146
### Longer explanation
65147

66148
We no longer publish `-SNAPSHOT` versions of Scala 2.
@@ -69,11 +151,15 @@ But the team does publish nightly versions, each with its own fixed version numb
69151

70152
To tell sbt to use one of these nightlies, you need to do three things.
71153

72-
First, add the resolver where the nightlies are kept:
154+
First, add the direct resolver where the nightlies are kept:
73155

74156
Global / resolvers += "scala-integration" at
75157
"https://scala-ci.typesafe.com/artifactory/scala-integration/"
76158

159+
Or use the Scala 3 nightly resolver as proxy for the same result:
160+
161+
Global / resolvers += Resolver.scalaNightlyRepository
162+
77163
Second, specify the Scala version:
78164

79165
scalaVersion := "2.13.1-bin-abcd123"

0 commit comments

Comments
 (0)