scala - Custom classloader fails after upgrading sbt from 0.12.2 to 0.13+ -
scala - Custom classloader fails after upgrading sbt from 0.12.2 to 0.13+ -
after updating build.properties
utilize sbt 0.13+ can no longer dynamically load case classes @ runtime.
with sbt 0.12.2 able utilize custom classloader, sbt 0.13.2 error: caused by: java.lang.classnotfoundexception: scala.product
here's runnable example. running sbt test
show error.
what changed in sbt 0.13 puts dynamic classloading shenanigans end, , how might prepare this?
thanks taking look!
-julian
edit:using sbt 0.13.7-m4 partially solves problem. sbt run
succeeds, while sbt test
gives different error, seems dynamically loaded class in each test beingness loaded twice.
the "loading twice" error in test due me not putting setup code within specs2 expectation.
in addition, need utilize different classloader in sbt 0.13+ : issue due using wrong classloader.
first tried classloader loader = classloader.getsystemclassloader();
, broke.
next, sbt 0.12.2, tried classloader loader = thread.currentthread().getcontextclassloader();
, broke sbt 0.13+.
now i'm using dummy class probe , classloader la probe.getclass().getclassloader()
, , seems have solved problem.
scala sbt classloader
Comments
Post a Comment