There is an Ant task called groovyc which works pretty similarly to the javac Ant task which takes a bunch of groovy source files and compiles them into Java bytecode. Each groovy class then just becomes a normal Java class you can use inside your Java code if you wish.
Indeed the generated Java class is indistinguishable from a normal Java class, other than it implements the
Compiling Groovy code to bytecode using Ant and Maven
class. You can see an example of this in action inside Groovy's maven.xml file (just search for 'groovyc')
You can also use the Ant task