When you apply gretty plugin, it adds farms extension to the current project.

You can (but you don’t have to) configure farms extension object in your gradle script:

farms {
  farm 'XYZ', {
    // ... properties
  }
  farm 'ABC', {
    // ... properties
  }
  // ...
}

Farms extension object holds map of farm names to farm definitions.

Default farm is already included into farm map with empty name.

Each named farm defines it’s own set of farm tasks: farmRunXYZ, farmRunDebugXYZ, etc., where "XYZ" is a farm name.

All farm tasks, when invoked on given project, use properties of their farm definition.

Each farm consists of two parts:

See also: Multiple web-apps.