I try to build a jar with Intellij Idea with Kotlin Gradle project. Idea doesn't see my main class when I try to configure Artifact
here's my Gradle :
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.3.60'
id 'application'
}
group 'org.vladdrummer'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin/'
}
jar {
manifest {
attributes 'Main-Class': 'MovieQuizBackendKt'
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
compile "com.sparkjava:spark-kotlin:1.0.0-alpha"
implementation 'com.google.code.gson:gson:2.8.2'
runtime 'mysql:mysql-connector-java:5.1.34'
testCompile group: 'junit', name: 'junit', version: '4.12'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
Here's structure :
Here's main class :
class MovieQuizBackend {
fun main(args: Array<String>) {
Server()
}
}