Which maven dependency to include for evaluating groovy scripts in java application

StackOverflow https://stackoverflow.com/questions/17615530

  •  02-06-2022
  •  | 
  •  

سؤال

I've added the ability to parse and evaluate groovy scripts inside my java application using GroovyShell. Which maven artifact is the bare minimum to include in my build?

I know that the groovy-all will definitely contain everything I need, but I'm guessing that there is a smaller package I could use as well?

هل كانت مفيدة؟

المحلول

groovy-jsr223 is the JSR-223 Engine implementation, and it support evaluation of groovy scripts via JSR-223 standard interface.

ScriptEngine scriptEngine = new ScriptEngineManager().getEngineByName("groovy");

<dependency>
   <groupId>org.codehaus.groovy</groupId>
   <artifactId>groovy-jsr223</artifactId>
   <version>2.4.6</version>
</dependency>
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top