Question

I am using a Scala template engine (Scalate) to compile templates at runtime within an OSGi environment (Scala 2.9.1). The templates cannot be pre-compiled because they are built dynamically.

In order for this to work, the Scala compiler needs to run within the OSGi environment. However, since the Scala compiler cannot take a classloader as input, this does not work out of the box.

From my research, there appears to be two general solution approaches:

1) A scala compiler plugin (there is one started here but it has not been touched since 2009, and messages on the scala list in 2009 stated it was not ready for production use.

2) Creating a virtual file system on top of the bundle context which could then be used by the Scala compiler. Apparently the Apache sling guys have successfully used this approach on an older version of Scala.

Has anyone gotten Scalate, Scala 2.9.1, and OSGi to work together to dynamically compile templates?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top