Reference

If you don't know EasyAnt at all, give a glance at its features, the FAQ and the tutorials before digging into this reference documentation.

How does it work?

Easyant-core.jar is in charge of : This can be configured in a configuration file.

Then it uses the loadmodule task provided by easyant, which basically parses an Ivy file (module.ivy similar to pom.xml for maven) and looks for easyant instructions.

Finally easyant tries to import an optional file called module.ant in the user directory (the module to build). In the examples, there is no such file, but this would let the user customize the build with an Ant script if necessary.

EasyAnt instructions in module.ivy

EasyAnt intructions in module.ivy files looks like this
<ea:build organisation="org.apache.easyant.buildtypes" module="build-std-java" revision="0.9">
<ea:property name="run.main.classname" value="org.apache.easyant.example.Example"/>
<ea:property name="target.artifacts" value="dist"/>
<ea:plugin module="run-java" revision="0.9"/>
</ea:build>
The idea is to have a very limited options to customize the build in the Ivy file: settings properties, specify build modules (buildtype / plugins). If you need more, you can use a module.ant file.

Let's try to understand how to use it.
'ea:build' tag is the main instruction, arguments references a build type, which tells which build module should be imported (considered as an import), see below.
Example:
<ea:build organisation="org.apache.easyant.buildtypes" module="build-std-java" revision="0.9">
You can also have property definition, as you would have in an Ant script
Example:
<ea:property name="target.artifacts" value="dist"/>
Usually build-type does the basic stuff. But sometimes we need something more (Source code management feature / code coverage etc...).
You can load several plugins using the plugin tag.
Example:
<ea:plugin module="run-java" revision="0.9"/>
In this example run-java module is loaded as a plugin(considered as an include).
As easyant proceeds with execution, all targets are imported in current project.

build modules:

There are two types of build modules:

Plugins

Build plugins are there to actually define each block of the build system. They interact with each other by relying on the file system and properties (for instance run-java expect java classes to be in directory pointed by ${target.main.classes}). Build plugin can define extensionPoints to make stuff pluggable.

Each build plugin define the expected "parameters" (i.e. the expected properties, paths) by using a parameter task like this:
<ea:parameter property="src.main.java" required="true" description="directory where sources to be compiled are" />
This is intended to be used both for validation and documentation.

build types:

A build type is a set of module preconfigured for a particular type of project (simple java jar, war, ...). EasyAnt comes with a set of build types modules relying on a standard lifecycle, but users could extend/replace it as they want. In most cases users will simply define the build type to use (either standard or a custom one ) and add specific plugins.