Arjan van Wieringen
07/25/2024, 6:06 PM./gradlew -Dio.ktor.development=true run
with this Gradle application configuration:
application {
mainClass.set("nl.helicotech.app.AppKt")
}
Because I am getting the following:
[main] INFO ktor.application - Autoreload is disabled because the development mode is off.
But this works:
application {
mainClass.set("nl.helicotech.app.AppKt")
applicationDefaultJvmArgs = listOf("-Dio.ktor.development=true")
}
Arjan van Wieringen
07/25/2024, 6:19 PMArjan van Wieringen
07/25/2024, 6:23 PMArjan van Wieringen
07/25/2024, 6:25 PMIf you run your application using a Gradle task, you can pass io.ktor.development to the applicationDefaultJvmArgs property in a *build.gradle(.kts)* file.
Arjan van Wieringen
07/26/2024, 5:11 AMAleksei Tirman [JB]
07/29/2024, 7:57 AMrun
task. You can define a property that could determine if the development mode is on:
application {
// ...
if (hasProperty("dev")) {
applicationDefaultJvmArgs = listOf("-Dio.ktor.development=true")
}
}
The usage:
./gradlew run -Pdev