Skip to content

[2.x] feat: Ivyless Maven repo publish#8692

Merged
eed3si9n merged 3 commits intosbt:developfrom
bitloi:issue-8688-ivyless-maven-publish
Feb 5, 2026
Merged

[2.x] feat: Ivyless Maven repo publish#8692
eed3si9n merged 3 commits intosbt:developfrom
bitloi:issue-8688-ivyless-maven-publish

Conversation

@bitloi
Copy link
Copy Markdown
Contributor

@bitloi bitloi commented Feb 5, 2026

Summary

Implements Ivyless Maven repo publish (issue #8688). When useIvy is false and publishTo is a Maven repo (MavenCache or MavenRepo), the publish task now uses the ivyless publisher and writes artifacts in Maven layout without Apache Ivy.

fixes #8688

Problem

With useIvy := false, publish only supported URLRepository and FileRepository (Ivy-style). Users setting publishTo := Some(MavenCache(...)) or publishTo := Some("name" at "http://...") hit the fallback and still used Ivy.

Solution

  • Handle MavenCache and MavenRepo in ivylessPublishTask: file repos via ivylessPublishMavenToFile, HTTP via ivylessPublishMavenToUrl.
  • Publish in Maven layout: groupId/artifactId/version/artifactId-version[-classifier].ext, with checksums.
  • Use credentialFor for credential matching (host and optional realm) and consume HTTP response body on success to avoid connection leaks.
  • Add scripted tests: ivyless-publish-maven (file), ivyless-publish-maven-http (HTTP PUT server).

Testing

  • mainProj/Test/test — unit tests (passed).
  • scalafmtCheckAll — lint (passed).
  • Scripted: dependency-management/ivyless-publish-maven, dependency-management/ivyless-publish-maven-http.

Checklist

  • Scripted tests added for file and HTTP Maven publish.
  • Follows project coding style (Scalafmt applied).
  • Signed the Scala CLA (if not already).

- Add ivylessPublishMavenToFile and ivylessPublishMavenToUrl for Maven layout
- Handle MavenCache and MavenRepo in ivylessPublishTask (file + HTTP)
- Add credentialFor for realm+host credential matching per Publishing docs
- Consume HTTP response body on success to avoid connection leak
- Add scripted tests: ivyless-publish-maven, ivyless-publish-maven-http
@bitloi
Copy link
Copy Markdown
Contributor Author

bitloi commented Feb 5, 2026

@eed3si9n Ready for review!

- Move library to subproject `a` (publisher)
- Add subproject `b` that consumes `a` from HTTP Maven repo
- Add GET support to HttpPutServer for artifact resolution
- Scope server tasks to Global to prevent port conflicts
- Remove dead publishToHttp task
@bitloi bitloi requested a review from eed3si9n February 5, 2026 08:42
eed3si9n

This comment was marked as resolved.

- Convert function bodies to braceless style
- Use `if ... then ... else` syntax
- Use `.foreach:` and `.map:` syntax
- Use `match` without braces
@bitloi bitloi requested a review from eed3si9n February 5, 2026 14:48
@bitloi
Copy link
Copy Markdown
Contributor Author

bitloi commented Feb 5, 2026

Thanks for the contribution! I think the over PR looks good.

Since this is a fresh code, could you follow the coding style guideline and minimize { and use the new school "fewer braces" Scala 3 syntax please? - https://github.com/sbt/sbt/blob/develop/contributing-docs/03_coding_style.md#braces

Done! Updated to use Scala 3 "fewer braces" syntax:

  • Converted function bodies to use = without braces
  • Changed match { case ... } to match without braces
  • Changed if (...) { } else { } to if ... then ... else
  • Changed .foreach { x => } to .foreach: x =>
  • Changed .map { x => } to .map: x =>
  • Changed .collect { case ... } to .collect: case ...

All tests pass (ivyless-publish-maven and ivyless-publish-maven-http).

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 @bitloi!

@eed3si9n eed3si9n changed the title feat: [2.x] Ivyless Maven repo publish [2.x] feat: Ivyless Maven repo publish Feb 5, 2026
@eed3si9n eed3si9n merged commit 5454804 into sbt:develop Feb 5, 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 Maven repo publish

2 participants