atom feed4 messages in[groovy-dev] Groovy in Apache Sling
FromSent OnAttachments
Felix MeschbergerDec 10, 2008 12:31 am 
Guillaume LaforgeDec 10, 2008 2:41 am 
Paul KingDec 10, 2008 2:50 am 
Felix MeschbergerDec 10, 2008 6:12 am 
Subject:[groovy-dev] Groovy in Apache Sling
From:Felix Meschberger (
Date:Dec 10, 2008 12:31:45 am

Hi all,

It is great to see Groovy deploy and use unmodified in Sling. There is one catch, though: Application provided classes are not visible to the Groovy library when running scripts.

In other Script engines in Sling, we set the Bundle manifest header:

DynamicImport-Package: *

which causes a dynamic resolution of packages from the OSGi framework on-demand.

I quickly tested a patch to the build.xml script:

Index: build.xml =================================================================== --- build.xml (Revision 14334) +++ build.xml (Arbeitskopie) @@ -496,6 +496,7 @@ <attribute name="Bundle-RequiredExecutionEnvironment" value="@{bundleEnvironment}" /> <attribute name="Eclipse-BuddyPolicy" value="dependent"/> <attribute name="Eclipse-LazyStart" value="true"/> + <attribute name="DynamicImport-Package" value="*"/> </manifest> </sequential> </macrodef>

which seems to help and allows me to run scripts, which use classes from outside the Groovy import scope.

Any chances of getting such an addition into the 1.6 branch already ?

Thanks and Regards Felix