Недавно я хотел использовать Ktor для одного из моих проектов с Gradle в качестве инструмента для сборки.
Я добавил зависимость, как упомянуто в документации, но не могу использовать ее в коде. Нет импорта HttpClient для Ktor. Intellisense также ничего не показывает.
Вот мой файл build.gradle:
ext.kotlin_version = '1.3.61'
ext.ktor_version = '1.3.2'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id 'org.jetbrains.intellij' version '0.4.18'
id 'org.jetbrains.kotlin.jvm' version '1.3.61'
}
group 'org.example'
version '1.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'kotlin'
repositories {
mavenCentral()
jcenter()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation "io.ktor:ktor-server-netty:1.3.2"
}
// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
version '2019.3.3'
alternativeIdePath "/Applications/WebStorm.app"
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
patchPluginXml {
changeNotes """
Add change notes here.<br>
<em>most HTML tags may be used</em>"""
}
Вот мой intellisense:
![enter image description here](https://i.stack.imgur.com/f7VwU.png)
Дайте мне знать, что я делаю не так. Это плагин Intellij Project.