One of the ways of running a Groovy script from Java is using GroovieShell. First, add the groovy-all Maven dependency (consider using a fresher version):

<dependency>
	<groupId>org.codehaus.groovy</groupId>
	<artifactId>groovy-all</artifactId>
	<version>2.1.5</version>
</dependency>

Read More →