-
-
Notifications
You must be signed in to change notification settings - Fork 202
Closed
Description
Using the jooby-cli to generate my first Kotlin-Gradle Jooby app with the command below:
jooby> create myJoobyApp --kotlin --gradle --server=undertow
run the app :
./gradlew joobyRun
Here is the error:
...
`> Task :compileKotlin FAILED
e: file:///home/ckkhui/apps/Projects/joobyPj/testApp/src/main/kotlin/app/App.kt:5:17 Unresolved reference 'undertow'.
e: file:///home/ckkhui/apps/Projects/joobyPj/testApp/src/main/kotlin/app/App.kt:8:11 Unresolved reference 'UndertowServer'.
The problem is, the cli didn't generate dependency for undertow, instead it used the Netty dependency in gradle.build.kts, so here is the change I made to successfully run the generated jooby app:
- In
gradle.build.kts
implementation("io.jooby:jooby-undertow")
// and remove the line below
//implementation("io.jooby:jooby-netty")BTW, since we're already in gradle build file, the development of theshadow plugin has moved to com.gradleup.shadow, hence I made this change as well:
id("com.gradleup.shadow") version "8.3.7"
// id("com.github.johnrengelman.shadow") version "8.1.1"
- Remove the manual install in
App.kt(Optional)
..
//import io.jooby.undertow.UndertowServer
..
..
class App: Kooby({
// install(UndertowServer())
...
})After these changes, I was able to run the sample app without problems.