Agreed. I have also tested such a use case and it looks like the Groovy bundle cannot see the required classes.
The only viable solution, I know of, and which we also use in our own ScriptEngine implementation bundles, is to set the DynamicImport-Package header to "*" meaning to try to resolve all unknown classes in the framework on-demand and only failing if the classes are not available from any exports in the framework.
I have posted a potential extension to the Groovy build in .
In short, it only requires a very small patch to the Groovy build.xml file (against the Groovy 1.6 branch):
— build.xml (Revision 14334)
+++ build.xml (Arbeitskopie)
@@ -496,6 +496,7 @@
<attribute name="Bundle-RequiredExecutionEnvironment" value="@
<attribute name="Eclipse-BuddyPolicy" value="dependent"/>
<attribute name="Eclipse-LazyStart" value="true"/>
+ <attribute name="DynamicImport-Package" value="*"/>