-
Notifications
You must be signed in to change notification settings - Fork 20
Closed
Description
in projects such as kamon
https://github.com/kamon-io/Kamon
eclipse/scala-test aspectj tests are not runnable due to wrong classloader setup
https://github.com/scalatest/scalatest-eclipse-plugin/blob/master/org.scala-ide.sdt.scalatest/src/scala/tools/eclipse/scalatest/launching/ScalaTestLauncher.scala#L45
problem arises as follows:
- scala-test is launched with
-javaagent:aspectjweaving.jar
- system classloader is empty and injected by jvm into aspectj
- aspectj finds no
META-INF/aop.xml
and disables any further class transform form system classloader
-
scala-test launcher is hacking system classloader in
main()
by adding all the jars from eclipse class path, but aspectj will never see the change -
all following tests fail, since
META-INF/aop.xml
are present, but ignored by aspectj.
solution:
- create a class path url array first and build child classloader from final array
- when child classloader is injected by jvm into aspectj, it will discover all metadata
Metadata
Metadata
Assignees
Labels
No labels