Skip to content

Commit 45ab0ab

Browse files
authored
Add a blog post about the new Scala nightlies repository (repo.scala-lang.org) (#1847)
1 parent 59a8aae commit 45ab0ab

File tree

1 file changed

+120
-0
lines changed

1 file changed

+120
-0
lines changed
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
---
2+
category: blog
3+
permalink: /news/new-scala-nightlies-repo.html
4+
title: A new repository for Scala nightlies
5+
by: Piotr Chabelski, Hamza Remmal & Scala Core Team
6+
---
7+
8+
Recently, we introduced a new repository to which nightlies of Scala will be published. From now on, the place to look for nightly versions will be [https://repo.scala-lang.org/](https://repo.scala-lang.org/). This also applies to nightly versions published before the change.
9+
10+
Both Scala 2 and Scala 3 nightly versions are available on the new repository.
11+
12+
## Why was the change made?
13+
14+
As a result of a number of features to be delivered in Scala 3.8, chief among them the standard library built with Scala 3, the size of the average Scala 3 release has increased considerably. Based on that fact, we have decided it is no longer suitable to publish them to Maven Central alongside stable releases, and a dedicated hosting space should be used instead.
15+
16+
## What exactly was changed?
17+
18+
Under the hood, it is only Scala 3 nightlies which are now published to a new repository. They used to be published to Maven Central until `3.8.0-RC1-bin-20250822-658c8bd-NIGHTLY` (or until the 23rd of August, 2025). All versions that followed have been published to [https://repo.scala-lang.org/](https://repo.scala-lang.org/). Versions from before the change are still available on [https://repo.scala-lang.org/](https://repo.scala-lang.org/), which also serves as a proxy to Maven Central.
19+
20+
At the time of writing of this blog post, only Scala 3.8 nightlies are published directly to the new repository. The change is planned to be backported to Scala 3.3 LTS.
21+
22+
Scala 2 nightlies have been published to [a dedicated repository](https://scala-ci.typesafe.com/artifactory/scala-integration/) for a long time and this, in fact, did not and likely will not change. The new repository does, however, serve as a proxy to [the Scala 2 nightly repository](https://scala-ci.typesafe.com/artifactory/scala-integration/), so from a user’s perspective, everything is in one place now.
23+
24+
## How does it affect users?
25+
26+
If you want to try out Scala nightly versions, it is now advised to use [https://repo.scala-lang.org/](https://repo.scala-lang.org/), regardless whether you are interested in Scala 3 Next, Scala 3.3 LTS, Scala 2.13 or Scala 2.12.
27+
28+
To use the newest Scala 3 Next nightlies, it is now necessary to use the new repository.
29+
This can be achieved by adding [https://repo.scala-lang.org/artifactory/maven-nightlies](https://repo.scala-lang.org/artifactory/maven-nightlies) as a resolver (details in examples provided in a later section of this blog post).
30+
31+
If you have existing builds testing Scala 2.13 and 2.12 nightlies, you don’t really need to do anything, as there is no change to how these nightlies are published. The new repository serves only as a proxy for them.
32+
33+
When using Scala 3 nightlies predating 23.08.2025, no change is necessary, either.
34+
35+
Even if the change isn’t necessary for the nightly you need, we now advise to always rely on the new repository for simplicity and easy issue reproduction’s sake
36+
37+
## Usage with tooling
38+
39+
As mentioned above, additional configuration of a resolver for the new repository is necessary for some tools in the ecosystem. Check the examples below.
40+
41+
### Scala CLI
42+
43+
Scala CLI v1.9.0 or newer (provided in Scala 3 installations since 3.7.3) is necessary to use the new nightly repository.
44+
45+
No additional resolver has to be configured, the CLI adds it implicitly when a nightly version is used.
46+
47+
Nightly versions can be provided from the command line:
48+
49+
```bash
50+
scala -e 'println("Hello") -S 3.nightly
51+
scala -e 'println("Hello") -S 3.3.nightly
52+
scala -e 'println("Hello") -S 2.13.nightly
53+
scala -e 'println("Hello") -S 2.nightly # same as 2.13.nightly
54+
scala -e 'println("Hello") -S 2.12.nightly
55+
```
56+
57+
…or via `//> using` directives, as before:
58+
59+
```scala
60+
//> using scala 3.nightly
61+
//> using scala 3.3.nightly
62+
//> using scala 2.nightly
63+
//> using scala 2.13.nightly
64+
//> using scala 2.12.nightly
65+
```
66+
67+
See [this Scala CLI doc page](https://scala-cli.virtuslab.org/docs/commands/compile/#scala-nightlies) for details.
68+
69+
### SBT
70+
71+
A util has been added in SBT 1.11.5 for easy configuration of the resolver for the new nightly repository. It can be found under `Resolver.scalaNightlyRepository`.
72+
73+
Here’s an example `build.sbt` file:
74+
75+
```scala
76+
ThisBuild / scalaVersion := "3.8.0-RC1-bin-20250916-eb1bb73-NIGHTLY"
77+
ThisBuild / resolvers += Resolver.scalaNightlyRepository
78+
lazy val root = (project in file("."))
79+
.settings(name := "sbt-with-scala-nightlies")
80+
```
81+
82+
### Mill
83+
84+
Mill 1.0.5 or newer is necessary to use Scala 3.8 (and as a result, all the new nightlies).
85+
86+
Here’s an example `build.mill` file:
87+
88+
```scala
89+
package build
90+
import mill.*
91+
import mill.api.*
92+
import scalalib.*
93+
94+
def scalaNightlyRepo = "https://repo.scala-lang.org/artifactory/maven-nightlies"
95+
96+
object project extends ScalaModule {
97+
def jvmWorker = ModuleRef(CustomJvmWorkerModule)
98+
override def scalaVersion = "3.8.0-RC1-bin-20250916-eb1bb73-NIGHTLY"
99+
override def repositories = Task { super.repositories() ++ Seq(scalaNightlyRepo)}
100+
}
101+
102+
object CustomJvmWorkerModule extends JvmWorkerModule, CoursierModule {
103+
override def repositories = Task { super.repositories() ++ Seq(scalaNightlyRepo)}
104+
}
105+
```
106+
107+
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. Refer to [this Mill documentation page](https://mill-build.org/mill/javalib/dependencies.html#_repository_config ) for more details regarding this syntax.
108+
109+
### Other tools
110+
111+
In most cases it should be sufficient to add a resolver for [https://repo.scala-lang.org/artifactory/maven-nightlies](https://repo.scala-lang.org/artifactory/maven-nightlies) to the build configuration before using a Scala nightly version. If you encounter any issues, be sure to raise them with tool maintainers.
112+
113+
## Further reading
114+
115+
We have updated [the nightly version documentation](https://docs.scala-lang.org/overviews/core/nightlies.html).
116+
117+
Other relevant documentation:
118+
- [Scala CLI on nightly versions](https://scala-cli.virtuslab.org/docs/commands/compile/#scala-nightlies)
119+
- [SBT docs on resolvers](https://www.scala-sbt.org/1.x/docs/Resolvers.html)
120+
- [Mill docs on repository config](https://mill-build.org/mill/javalib/dependencies.html#_repository_config)

0 commit comments

Comments
 (0)