Previously I built ktor docker images by using the...
# ktor
r
Previously I built ktor docker images by using the installDist task, but after switching to multiplatform the
lib/<projectname>-<version>.jar
file has disappeared and running fails with an error:
Exception in thread "main" java.lang.IllegalArgumentException: Neither port nor sslPort specified. Use command line options -port/-sslPort or configure connectors in application.conf
I’ve tried reproducing by using the (CIO) ‘full stack web application’ project generator which basically fails with the same error, since it doesn’t use HOCON:
Caused by: java.lang.ClassNotFoundException: com.test.fullstack.application.ServerKt
b
Do you use withJava() dsl on your jvm target?
It's needed for java plugin interop
r
Yes, a
withJava()
call is present in both projects under
kotin { jvm {
b
Is application.conf present in your resources?
r
In the jvmMain resources, the repro is freshly generated and uses
embeddedServer
b
Which ktor version are you on?
r
2.0.0-beta1
and
1.6.3
, with gradles 7+ and kotlin
1.6.10
b
Can you share your build.gradle.kts?
r
b
I can't remember why, but I think I couldn't get it to work with mpp as well. Ended up switching to fat jar instead https://github.com/mpetuska/kamp/blob/master/app/build.gradle.kts
1
r
Ah, I somewhat suspected such a thing. Thank you, I’ll give that a try
b
I guess it only works with kotlin jvm plugin
r
@Big Chungus Deployed to staging today. You’re a hero 👍
b
Exciting!