You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to use s3-support from mill and getting exception: java.lang.ClassNotFoundException: com.amazonaws.services.s3.AmazonS3.
The build.sc looks like:
import mill._
import scalalib._
import coursier.maven.MavenRepository
import $ivy.`io.get-coursier:s3-support:0.2.0`
import $ivy.`com.amazonaws:aws-java-sdk-s3:1.12.506`
coursier.s3support.s3.Setup.setup()
case object Versions {
val catsVersion = "2.9.0"
val catsEffectVersion = "3.5.0"
}
case object Dependencies {
import Versions._
val common = ivy"tech.xeppaka::common:0.41.0"
val catsCore = ivy"org.typelevel::cats-core:$catsVersion"
val catsEffect = ivy"org.typelevel::cats-effect:$catsEffectVersion"
}
object `effects-app-001` extends RootModule with SbtModule {
def scalaVersion = "2.13.11"
def ivyDeps =
Agg(Dependencies.catsCore, Dependencies.catsEffect, Dependencies.common)
def repositoriesTask = T.task {
super.repositoriesTask() ++ Seq(
MavenRepository(
"s3://bucket-with-artifacts/m2/releases"
)
)
}
}
I think the problem is that Thread.currentThread().getContextClassLoader() is used to load AmazonS3 class. Could you consider using getClass().getClassLoader() or accept a ClassLoader as parameter to coursier.s3support.s3.Setup.setup() instead?
Trying to use
s3-support
from mill and getting exception: java.lang.ClassNotFoundException: com.amazonaws.services.s3.AmazonS3.The
build.sc
looks like:I think the problem is that
Thread.currentThread().getContextClassLoader()
is used to loadAmazonS3
class. Could you consider usinggetClass().getClassLoader()
or accept a ClassLoader as parameter tocoursier.s3support.s3.Setup.setup()
instead?There is also good info on stackoverflow regarding class loader: https://stackoverflow.com/questions/1771679/difference-between-threads-context-class-loader-and-normal-classloader
The text was updated successfully, but these errors were encountered: