The issue was that I can't call a function in a class that imports something that is not on the classpath, so it was illegal for the importStylesheet function to call
OSGISupport.getBundle
. I changed it so it first checks if the OSGi runtime is available before it calls
getBundle
so that should solve it. Optional dependencies like this is a bit tricky 🙂