Resolvers: clarify deprecation pointer to `sonatypeCentralSnapshots`

The current deprecation messages for `sonatypeRepo()` & `sonatypeOssRepos()` (added with https://github.com/sbt/librarymanagement/pull/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](76234e013f/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")`
This commit is contained in:
Roberto Tyley 2025-08-03 23:06:19 -04:00 committed by Eugene Yokota
parent 9e483d62ca
commit 20eb474043
1 changed files with 2 additions and 2 deletions

View File

@ -143,7 +143,7 @@ private[librarymanagement] abstract class ResolverFunctions {
)
@deprecated(
"""Sonatype OSS Repository Hosting (OSSRH) will be sunset on 2025-06-30; use the following instead:
"""Sonatype OSS Repository Hosting (OSSRH) was sunset on 2025-06-30; remove this resolver. If snapshots are required, use:
resolvers += Resolver.sonatypeCentralSnapshots
""",
"1.7.0"
@ -161,7 +161,7 @@ private[librarymanagement] abstract class ResolverFunctions {
)
@deprecated(
"""Sonatype OSS Repository Hosting (OSSRH) will be sunset on 2025-06-30; use the following instead:
"""Sonatype OSS Repository Hosting (OSSRH) was sunset on 2025-06-30; remove this resolver. If snapshots are required, use:
resolvers += Resolver.sonatypeCentralSnapshots""",
"1.11.2"
)