Sean Keane
06/11/2020, 4:07 PMbuild.gradle.kts
instead of build.gradle
. When I configure it from the wizard and build it works fine out of the box. When I convert the file I get the following error.
INFO Application - No ktor.deployment.watch patterns specified, automatic reload is not active
Exception in thread "DefaultDispatcher-worker-3" java.lang.ClassNotFoundException: Module function cannot be found for the fully qualified name 'com.example.ApplicationKt.module'
This is my build.gradle.kts
file
buildscript {
repositories {
jcenter()
mavenCentral()
maven{
url = uri("<https://kotlin.bintray.com/ktor>")
url = uri("<https://kotlin.bintray.com/kotlinx>")
}
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72")
}
}
//Setup the application plugins
plugins {
application
kotlin("jvm") version "1.3.72"
}
group = "com.example"
version = "0.0.1"
application {
mainClassName = "io.ktor.server.cio.EngineMain"
}
sourceSets["main"].resources.srcDirs("resources")
sourceSets["test"].resources.srcDirs("testresources")
repositories {
mavenCentral()
mavenLocal()
jcenter()
maven{
url = uri("<https://kotlin.bintray.com/ktor>")
url = uri("<https://kotlin.bintray.com/kotlinx>")
}
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation("io.ktor:ktor-server-cio:1.3.2")
implementation("ch.qos.logback:logback-classic:1.2.1")
implementation("io.ktor:ktor-server-core:1.3.2")
implementation("io.ktor:ktor-locations:1.3.2")
implementation("io.ktor:ktor-metrics:1.3.2")
implementation("io.ktor:ktor-client-core:1.3.2")
implementation("io.ktor:ktor-client-core-jvm:1.3.2")
implementation("io.ktor:ktor-client-cio:1.3.2")
implementation("io.ktor:ktor-client-json-jvm:1.3.2")
implementation("io.ktor:ktor-client-gson:1.3.2")
implementation("io.ktor:ktor-client-logging-jvm:1.3.2")
testImplementation("io.ktor:ktor-server-tests:1.3.2")
}
Im not really sure why its not picking it up.Sean Keane
06/11/2020, 4:14 PMapplication.conf
ktor {
deployment {
port = 8080
port = ${?PORT}
}
application {
modules = [ com.example.ApplicationKt.module ]
}
}
Sean Keane
06/11/2020, 4:28 PMkotlin.sourceSets["main"].kotlin.srcDirs("src")
kotlin.sourceSets["test"].kotlin.srcDirs("test")