Scala 3 client-codegen CompileTimeCalibanPlugin is not functional
As reported on discord:
I'm having trouble generating a client but am in depth looking working through the https://ghostdogpr.github.io/caliban/docs/client-codegen.html#compiletimecalibanplugin and wondering if it could possibly be broken or if there's something specific to my project that is not compatible.
When I compile I see in target a directory ctCalibanServer which contains a a scala file called CalibanClientGenerator_0 and I also see a metadata resource that looks like a string. I believe that this generator is supposed to have it's main method executed but I believe that's not happening. In my graphql-client I see the package path in src/main/scala but I don't see any client generated.
I tried to tinker with it for a little while. But I ended up writing a simple wrapper and just calling that and it works.
I have since worked out the following reproduction based upon the provided sources in the caliban project.
Reproduction:
caliban/codegen-sbt/src/sbt-test/compiletime-codegen/test-compile$ sbt -Dplugin.version=2.11.1 "++3.3.7" "posts/compile;posts-clients/compile"
[info] welcome to sbt 1.11.7 (Ubuntu Java 21.0.9)
[info] loading global plugins from /home/discord/.sbt/1.0/plugins
[info] loading settings for project test-compile-build from plugins.sbt...
[info] loading project definition from /share/code/domain/schema-api/caliban-reference/caliban/codegen-sbt/src/sbt-test/compiletime-codegen/test-compile/project
[info] loading settings for project poc_compile_time_caliban_client_generation from build.sbt...
[info] set current project to poc_compile_time_caliban_client_generation (in build file:/share/code/domain/schema-api/caliban-reference/caliban/codegen-sbt/src/sbt-test/compiletime-codegen/test-compile/)
[info] Setting Scala version to 3.3.7 on 6 projects.
[info] Reapplying settings...
[info] set current project to poc_compile_time_caliban_client_generation (in build file:/share/code/domain/schema-api/caliban-reference/caliban/codegen-sbt/src/sbt-test/compiletime-codegen/test-compile/)
[success] Total time: 0 s, completed Dec 8, 2025, 6:57:21 PM
[info] ctCalibanClient - Starting to generate...
[info] running caliban.generator.CalibanClientGenerator_2 /share/code/domain/schema-api/caliban-reference/caliban/codegen-sbt/src/sbt-test/compiletime-codegen/test-compile/modules/posts-clients/target/scala-3.3.7/src_managed/main
[info] running caliban.generator.CalibanClientGenerator_0 /share/code/domain/schema-api/caliban-reference/caliban/codegen-sbt/src/sbt-test/compiletime-codegen/test-compile/modules/posts-clients/target/scala-3.3.7/src_managed/main
[info] running caliban.generator.CalibanClientGenerator_1 /share/code/domain/schema-api/caliban-reference/caliban/codegen-sbt/src/sbt-test/compiletime-codegen/test-compile/modules/posts-clients/target/scala-3.3.7/src_managed/main
[error] java.lang.ClassNotFoundException: caliban.generator.CalibanClientGenerator_0
[error] at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
[error] stack trace is suppressed; run last posts / Compile / runMain for the full output
[error] java.lang.ClassNotFoundException: caliban.generator.CalibanClientGenerator_1
[error] at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
[error] stack trace is suppressed; run last posts / Compile / runMain for the full output
[error] java.lang.ClassNotFoundException: caliban.generator.CalibanClientGenerator_2
[error] at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
[error] stack trace is suppressed; run last posts / Compile / runMain for the full output
[error] (posts / Compile / runMain) java.lang.ClassNotFoundException: caliban.generator.CalibanClientGenerator_0
[error] (posts / Compile / runMain) java.lang.ClassNotFoundException: caliban.generator.CalibanClientGenerator_1