[BUG] Can't access Settings and Mapping DSL
Closed this issue · 1 comments
BierDav commented
Describe the bug
So the problem is that the IntelliJ Idea can't resolve this class com.jillesvangurp.searchdsls.mappingdsl.IndexSettingsAndMappingsDSL
and therefore you get an Unresolved reference: settings
on line 20.
To Reproduce
build.gradle.kts
repositories {
mavenCentral()
maven("https://maven.tryformation.com/releases") {
content {
includeGroup("com.jillesvangurp")
}
}
}
dependencies {
implementation("io.ktor:ktor-server-core-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-auth-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-auth-jwt-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-sessions-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-caching-headers-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-cors-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-content-negotiation-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-hsts-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-http-redirect-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-partial-content-jvm:$ktorVersion")
implementation("io.ktor:ktor-serialization-kotlinx-json-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-websockets-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-cio-jvm:$ktorVersion")
implementation("ch.qos.logback:logback-classic:$logbackVersion")
testImplementation("io.ktor:ktor-server-tests-jvm:$ktorVersion")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion")
// Database
implementation("com.jillesvangurp:search-client:2.0.0-RC-2")
// Kotlin scripting
implementation("org.jetbrains.kotlin:kotlin-scripting-common")
implementation("org.jetbrains.kotlin:kotlin-scripting-jvm")
implementation("org.jetbrains.kotlin:kotlin-scripting-dependencies")
implementation("org.jetbrains.kotlin:kotlin-scripting-dependencies-maven")
}
Application.kt:
import com.jillesvangurp.ktsearch.KtorRestClient
import com.jillesvangurp.ktsearch.SearchClient
import com.jillesvangurp.ktsearch.createIndex
import io.ktor.server.application.*
import io.ktor.server.cio.*
import kotlinx.coroutines.runBlocking
fun main(args: Array<String>): Unit =
EngineMain.main(args)
@Suppress("unused")
fun Application.module() {
val client = SearchClient(KtorRestClient(user = "elastic", password = "---"))
runBlocking {
client.createIndex("languages") {
settings {
}
}
}
}
Expected behavior
No error
Your context
This is probably a configuration problem when you compare the structure of the libraries you can see that search-dsls features another structure as the other two modules:
Will you be able to help with a pull request?
I have already submitted a pull request, but not sure if it solves the problem
jillesvangurp commented
I merged your PR. Thanks. Let me know if there are any further issues after I release this (soonish).