I am trying to connect with two elasticsearch clusters using scala code and query elasticsearch from them. using following libraries and code in build.sbt of scala project:
libraryDependencies +="org.elasticsearch" % "elasticsearch" % "7.2.0"
libraryDependencies += "org.elasticsearch.client" % "elasticsearch-rest-high-level-client" % "7.2.0"
AND
val elastic4sVersion = "6.2.8"
libraryDependencies ++= Seq(
"com.sksamuel.elastic4s" %% "elastic4s-core" % elastic4sVersion,
// for the http client
"com.sksamuel.elastic4s" %% "elastic4s-http" % elastic4sVersion,
)
These has a common client library, which gets missing when building. I can see either 6.x or 7.x but not both. I tried the shading approach
assemblyShadeRules in assembly := Seq(
ShadeRule.rename("org.elasticsearch.client.**" -> "my_conf.@1")
.inLibrary("org.elasticsearch.client" % "elasticsearch-rest-high-level-client" % "7.2.0")
.inAll
)
assemblyShadeRules in assembly := Seq(
ShadeRule.rename("org.elasticsearch.client.**" -> "my_conf_1.@1")
.inLibrary("org.elasticsearch.client" % "elasticsearch-rest-high-level-client" % "6.2.2")
.inAll
)
assemblyShadeRules in assembly := Seq(
ShadeRule.rename("org.elasticsearch.elasticsearch.**" -> "my_configuration.@1")
.inLibrary("org.elasticsearch" % "elasticsearch" % "7.2.0")
.inAll
)
but I can not can not get the shaded versions available and get error when trying to import them in projet references.