Using Spring Dynamic Languages Support from Groovy Configuration
Why don't just
@BeanScriptFactoryPostProcessor scriptFactory() { ScriptFactoryPostProcessor sfpp = new ScriptFactoryPostProcessor() sfpp.setDefaultRefreshCheckDelay(1000) return sfpp}
Simpler alternatives:
- put FooBarService on the classpath and annotate it with @Component
or
- use the lang namespace in mybeans.xml
-
<lang:groovy id="foobarService" script-source="file:src/main/static/FoobarService.groovy" />
Application.groovy
@SpringBootApplication@ImportResource("classpath:mybeans.xml")public class Application { public static void main(String[] args) { SpringApplication.run(Application, args) }}