Alexandre
12/23/2018, 6:37 PM./gradlew :teste:run
FAILURE: Build failed with an exception.
* What went wrong:
Project 'teste' not found in root project 'teste'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at <https://help.gradle.org>
BUILD FAILED in 0s
This is my gradle file:
buildscript {
ext.gretty_version = '2.0.0'
ext.kotlin_version = '1.3.11'
ext.ktor_version = '1.0.1'
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.akhikhl.gretty:gretty:$gretty_version"
}
}
plugins {
id 'java'
id 'org.jetbrains.intellij' version '0.3.12'
id 'org.jetbrains.kotlin.jvm' version '1.3.0'
}
apply plugin: 'kotlin'
apply plugin: 'war'
apply plugin: 'org.akhikhl.gretty'
webAppDirName = 'webapp'
gretty {
contextPath = '/'
logbackConfigFile = 'resources/logback.xml'
}
sourceSets {
main.kotlin.srcDirs = [ 'src' ]
main.resources.srcDirs = [ 'resources' ]
}
repositories {
jcenter()
maven { url "<https://kotlin.bintray.com/ktor>" }
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile "io.ktor:ktor-server-servlet:$ktor_version"
compile "io.ktor:ktor-html-builder:$ktor_version"
compile "ch.qos.logback:logback-classic:1.2.3"
}
kotlin.experimental.coroutines = 'enable'
task run
afterEvaluate {
run.dependsOn(tasks.findByName("appRun"))
}
where i'm worong?Lucas
12/23/2018, 6:58 PM./gradlew run
works?Lucas
12/23/2018, 7:01 PM./gradlew :teste:run
you need to have the source code in a Gradle subproject called teste
, which is not the case in the sample jetty-war
. Also it's not necessary to install Jetty manually for this sample, because Ktor will use an embedded version of it.Alexandre
12/23/2018, 8:04 PM