Skip to content

[2.x] feat: Ivyless publish to Ivy repo#8686

Merged
eed3si9n merged 7 commits intosbt:developfrom
bitloi:feat/ivyless-publish-8639
Feb 4, 2026
Merged

[2.x] feat: Ivyless publish to Ivy repo#8686
eed3si9n merged 7 commits intosbt:developfrom
bitloi:feat/ivyless-publish-8639

Conversation

@bitloi
Copy link
Copy Markdown
Contributor

@bitloi bitloi commented Feb 4, 2026

Ivy-less publish to HTTP (issue #8639)

Summary

Adds a scripted test for ivy-less publish over HTTP. The existing ivyless-publish test only covers publishing to a file resolver; this test verifies that ivy-less publish works when the destination is an HTTP URL (PUT to a repo).

Changes

  • New scripted test ivyless-publish-http: Runs a local HTTP server that accepts PUT requests to a repo directory, runs publish, then asserts the published layout (jars, poms, ivys, checksums) matches the expected ivy-style structure.
  • build.sbt: Uses java.net.URL explicitly for Resolver.url(...) because in build.sbt the literal url is sbt.URI; Resolver.url expects java.net.URL.

How to verify

Run the scripted test:

sbt "scripted dependency-management/ivyless-publish-http"

Related

Closes #8639

Implements ivyless publish task as part of sbt#7639 (drop Ivy dependency).
Fixes sbt#8639.

- Add ivylessPublish for URLRepository: HTTP PUT with optional Basic auth,
  same layout as ivyless publishLocal (artifacts + ivy.xml + checksums).
- Add ivylessPublishToFile for FileRepository: write to local path for
  testing without HTTP server.
- Add ivylessPublishTask: when useIvy is false, use ivyless path for
  URLRepository or FileRepository; otherwise use Ivy.
- Wire publish in Defaults to LibraryManagement.ivylessPublishTask
  (tagged Publish, Network).
- Add scripted test dependency-management/ivyless-publish using
  Resolver.file to verify ivyless publish produces identical layout.

Credentials supported via allCredentials (Basic auth for PUT).
Per issue sbt#8639: scripted test where an HTTP server accepts PUT to repo
directory and publish uses ivyless publisher to upload via HTTP.

- project/HttpPutServer.scala: minimal JDK HttpServer that handles PUT
  and writes request body to baseDir/path (repo directory).
- publishTo := Resolver.url(..., http://localhost:3030)(ivyStylePatterns)
  with allowInsecureProtocol for localhost.
- publishToHttp task: start server, run publish, stop server.
- test: cleanPublishRepo, publishToHttp, checkIvylessPublish.
- Format LibraryManagement.scala with scalafmt
- Add PatternsBasedRepository branch for scripted classloader
- Write ivy.xml first in ivylessPublishLocal for consistent layout
The slash in optional patterns like (scala_[scalaVersion]/) is inside the
parentheses, not outside. Change regex from \\)/  to /\\) to correctly
strip these patterns from artifact URLs.

Fixes dependency-management/ivyless-publish-http test.
@bitloi
Copy link
Copy Markdown
Contributor Author

bitloi commented Feb 4, 2026

@eed3si9n Please check the pr and give me the result.

@bitloi
Copy link
Copy Markdown
Contributor Author

bitloi commented Feb 4, 2026

@eed3si9n Would you check the update again?

Copy link
Copy Markdown
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@eed3si9n eed3si9n changed the title Feat/ Ivy-less publish to HTTP [2.x] feat: Ivyless publish to Ivy repo Feb 4, 2026
@bitloi
Copy link
Copy Markdown
Contributor Author

bitloi commented Feb 4, 2026

@eed3si9n If you want to edit the pr description, I would like you to edit it before you merge. Because it's related to my score. Thanks for your quick approval!!!

@eed3si9n eed3si9n merged commit b460bb8 into sbt:develop Feb 4, 2026
15 checks passed
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.

[2.x] Ivyless Ivy repo publish

2 participants