Skip to: Site menu | Main content

Groovy 

      Download | Documentation | Developers | Community

An agile dynamic language for the Java Platform

Ant Integration with Groovy Add comment to Wiki View in Wiki Edit Wiki page Printable Version

Introduction

Ant is the predominant build environment for Java projects. Groovy is a leading Scripting language for the JVM. The good news is that you can use them together easily and with many benefits.

Existing Ant Users (Java Projects): If you are already familiar with using Ant with a traditional build.xml file, then you can continue to do so with almost no changes. If you want you can begin to use the <groovy> Ant task to bring the full power of a scripting language to your build scripts.

Existing Ant Users (Groovy or mixed Groovy/Java Projects): If you wish to pre-compile your Groovy scripts as part of your build process (it can help catch syntactic errors earlier if you do) then you need to know about the <groovyc> Ant task. You will find it almost identical to the javac task which you are probably already familiar with.

Existing Groovy Users: You probably want to consider how you can use AntBuilder to leverage the many available Ant tasks directly in your code using a DSL-style notation. You can leverage Ant Libraries in the same way.