Skip to content

build: cross-publish artifacts for Scala 2.13 - #2

Merged
hongwei1 merged 1 commit into
OpenBankProject:mainfrom
hongwei1:build/cross-publish-scala-2.13
Aug 14, 2026
Merged

build: cross-publish artifacts for Scala 2.13#2
hongwei1 merged 1 commit into
OpenBankProject:mainfrom
hongwei1:build/cross-publish-scala-2.13

Conversation

@hongwei1

Copy link
Copy Markdown
Collaborator

Why

OBP-API is being migrated to Scala 2.13, and it consumes this repository through JitPack as com.github.OpenBankProject.lift-persistence:lift-persistence_${scala.version}. That artifact does not exist for 2.13:

lift-persistence_2.12-v1.0.4.pom -> HTTP 200
lift-persistence_2.12-v1.0.4.jar -> HTTP 200
lift-persistence_2.13-v1.0.4.pom -> HTTP 404
lift-persistence_2.13-v1.0.4.jar -> HTTP 404

The cause is visible in the JitPack build log for v1.0.4:

Running: sbt -Dsbt.log.noformat=true clean publishM2

JitPack's default sbt command has no +, so it publishes only the default Scala version. crossScalaVersions has always listed a 2.13 entry, but nothing ever published it. Tagging a new release without fixing this would still produce a 2.12-only artifact.

What

  • Add jitpack.yml overriding the install command with +publishM2, so a single tag publishes both lift-persistence_2.12 and lift-persistence_2.13.
  • Align the cross-build compiler versions with the ones OBP-API uses: 2.12.20 -> 2.12.21 and 2.13.16 -> 2.13.18, so the artifact and its consumer are built by the same compiler.

Verification

sbt +clean +compile +test on JDK 25, both versions, no source changes required:

Scala main sources test sources Result
2.12.21 63 26 Passed: Total 406, Failed 0, Errors 0
2.13.18 63 26 Passed: Total 406, Failed 0, Errors 0

Zero [error] lines in the build log.

After this merges and a tag is cut, both artifacts must be verified by fetching the pom and jar directly — JitPack's maven-metadata.xml lists versions that do not exist and cannot be used as evidence.

JitPack runs `sbt clean publishM2` for sbt projects, which publishes only the
default Scala version. Every tag up to v1.0.4 therefore ships
lift-persistence_2.12 while lift-persistence_2.13 returns 404, even though
crossScalaVersions has always listed a 2.13 entry. Add a jitpack.yml that
overrides the install command with `+publishM2` so one tag publishes both.

Also align the cross-build compiler versions with the ones OBP-API uses
(2.12.20 -> 2.12.21, 2.13.16 -> 2.13.18) so the artifact and its consumer are
built by the same compiler. Both versions compile and pass all 406 tests
unchanged.
@hongwei1
hongwei1 merged commit 3ecb401 into OpenBankProject:main Aug 14, 2026
1 check 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.

1 participant