Skip to content

Conversation

eed3si9n
Copy link
Member

@eed3si9n eed3si9n commented Jun 7, 2025

@eed3si9n eed3si9n merged commit c2f0529 into sbt:develop Jun 7, 2025
5 checks passed
@eed3si9n eed3si9n deleted the wip/sonatype branch June 7, 2025 06:02
rtyley added a commit to rtyley/librarymanagement that referenced this pull request Jul 10, 2025
The current deprecation messages for `sonatypeRepo()` & `sonatypeOssRepos()` (added with sbt#517) say:

> use the following instead: resolvers += Resolver.sonatypeCentral**Snapshots**

...but following this advice can expose projects to using **snapshot** artifacts when they did not previously! This is unfortunate, as snapshots artifacts are inherently more risky, due to being mutable.

For example, invocations of `sonatypeOssRepos()` like [this](https://github.com/guardian/frontend/blob/76234e013f550ac600fbf0bb924c19a1a6165295/project/plugins.sbt#L10):

```scala
resolvers ++= Resolver.sonatypeOssRepos("releases")
```

...should _not_ be replaced by `sonatypeCentralSnapshots()`, as, AFAIK, only non-snapshot releases would be in `sonatypeOssRepos("releases")`.

In an ideal world (where snapshots are not, and were not, being used!) the `sonatypeOssRepos()` entry should just be [removed](guardian/frontend#28084) (as I don't _think_ there is any useful equivalent now that we're using Central Portal? In the old days we could get our artifacts a little quicker with `sonatypeOssRepos()`).

Only if snapshots are in use should users replace the entry with `sonatypeCentralSnapshots()`
eed3si9n pushed a commit to eed3si9n/sbt that referenced this pull request Aug 4, 2025
The current deprecation messages for `sonatypeRepo()` & `sonatypeOssRepos()` (added with sbt/librarymanagement#517) say:

> use the following instead: resolvers += Resolver.sonatypeCentral**Snapshots**

...but following this advice can expose projects to using **snapshot** artifacts when they did not previously! This is unfortunate, as snapshots artifacts are inherently more risky, due to being mutable.

For example, invocations of `sonatypeOssRepos()` like [this](https://github.com/guardian/frontend/blob/76234e013f550ac600fbf0bb924c19a1a6165295/project/plugins.sbt#L10):

```scala
resolvers ++= Resolver.sonatypeOssRepos("releases")
```

...should _not_ be replaced by `sonatypeCentralSnapshots()`, as, AFAIK, only non-snapshot releases would be in `sonatypeOssRepos("releases")`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant