I am trying to access the files under the resource folder while running streamlets. Below is my sbt structure.
i want to access files under streamlets -> src -> main -> resources.
i use
getClass.getClassLoader.getResource(s"file.txt")
running locally, it's working, but while running in cluster
getting error, no file and directory.
Please assist .
adding build.sbt :-
lazy val root = project.in(file(".")).aggregate(streamlets, app)
lazy val streamlets = project.in(file("streamlets"))
.enablePlugins(CloudflowAkkaPlugin, ScalaxbPlugin)
.settings(
name := s"$baseName-streamlets",
libraryDependencies ++= Seq(
"ch.qos.logback" % "logback-classic" % logbackVersion,
"org.scalactic" %% "scalactic" % "3.1.1" % "test",
"org.scalatest" %% "scalatest" % "3.1.1" % "test",
"com.lightbend.akka" %% "akka-stream-alpakka-s3" % alpakkaVersion,
"com.typesafe.akka" %% "akka-stream" % akkaVersion,
"com.typesafe.akka" %% "akka-http" % akkaHttpVersion,
"com.typesafe.akka" %% "akka-http-xml" % akkaHttpVersion,
"org.glassfish.jaxb" % "jaxb-runtime" % jaxbVersion, // for JDK11
)
)
lazy val app = project.in(file("app"))
.enablePlugins(CloudflowApplicationPlugin)
.settings(
name := s"$baseName-dev",
runLocalConfigFile := Some("app/src/main/resources/local.conf")
)
.dependsOn(streamlets)