Port ArtifactRegistryIvyResolver to Scala 3 / sbt 2#8
Merged
Conversation
…la 3 / sbt 2 The scala-2.12 (sbt 1.x) source set had ArtifactRegistryIvyRepository/ ArtifactRegistryIvyResolver, using a custom Ivy repository that PUTs via the Google HTTP client directly. This was never ported to the scala-3 (sbt 2.x) source set, so publishTo on sbt 2 falls back to Ivy's stock URLRepository, which only supports the http protocol for PUT and throws UnsupportedOperationException for artifactregistry://.
…ping Restores parity with the scala-2.12 (sbt 1.x) source set: a plain artifactregistry:// publishTo is now automatically wrapped with ArtifactRegistryIvyResolver, so it goes through the Google HTTP client PUT instead of Ivy's stock URLRepository, which only supports http.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scala-2.12(sbt 1.x) source set hasArtifactRegistryIvyRepository/ArtifactRegistryIvyResolver, a custom IvyAbstractRepositorythat PUTs artifacts via the Google HTTP client directly. This was never ported to thescala-3(sbt 2.x) source set.artifactregistry://publishToon sbt 2 falls through to Ivy's stockURLRepository, which hardcodesprotocol == "http"for PUT and throwsUnsupportedOperationException: URL repository only support HTTP PUT at the momentfor any other scheme — even though the JVM-wide URL handler is installed correctly.modules/sbt/src/main/scala-3/dev/rolang/sbt/gar/ArtifactRegistryIvyRepository.scala, a straight port (only an unusedjava.net.URLimport dropped).GarCompat's scala-3publishTomapping, restoring parity with the scala-2.12 version: a plainartifactregistry://publishTois now automatically wrapped withArtifactRegistryIvyResolveron sbt 2 as well.Test plan
sbt ++3.8.4 plugin/compile— compiles cleanlysbt ++2.12.21 plugin/compile— sbt 1.x cross-build still compiles, unaffectedsbt scalafmtCheckAll— clean🤖 Generated with Claude Code