6

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?

Billybong
  • 697
  • 5
  • 18
  • 2
    Not sure, but I think you should just need `org.codehaus.groovy:groovy:2.1.6` (which gets you down to 3.3MB from 6.1MB)... I guess it depends what your scripts want to do... – tim_yates Jul 12 '13 at 13:05
  • Seems you're right. I ended up depending on groovy-jsr223 and that seems to work. Half the size as you say... – Billybong Jul 12 '13 at 13:14

1 Answers1

5

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>
Shawn Guo
  • 3,169
  • 3
  • 21
  • 28