I am creating a sbt plugin. One of its features is to display a dependency graph of a given scala project (the one invoking this plugin). To do so, I use scalafx, which is still depending on a javafx jar. So I need to add in my plugin build.sbt the following command:
unmanagedJars in Compile += Attributed.blank(file(System.getenv("JAVA_ORACLE") + "/jre/lib/jfxrt.jar"))
It compiles and works well. But not when I use it as a plugin from another sbt project (with the addSbtPlugin command in the project/plugins.sbt). When I invoke the plugin, I get the following error:
java.lang.NoClassDefFoundError: javafx/event/EventTarget
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:787)
The javafx classes are not found in the classLoader. I tried the assembly plugin - but it is not packaged yet for scala 2.10 that I use.
Does anyone know how I can render my javafx jar available at runtime when it is invoked by my plugin ?
Thanks