<project default="buildall"
         xmlns:m="jelly:maven"
         xmlns:j="jelly:core">

  <!-- Cleans all projects. -->
  <goal name="cleanall">
    <m:reactor basedir="${basedir}/.."
               includes="*/project.xml"
               excludes="mavenbuild/project.xml"
               goals="clean"
               banner="Cleaning"
               ignoreFailures="false"/>
  </goal>

  <!-- Runs Jalopy on all projects. -->
  <goal name="formatall">
    <m:reactor basedir="${basedir}/.."
               includes="*/project.xml"
               excludes="mavenbuild/project.xml,junitppmod-maven-plugin/project.xml,maven-jboss-plugin/project.xml,thesetear/project.xml,appserver-maven-plugin/project.xml,cactus-maven-plugin/project.xml,index-ra-test/project.xml,javasource-maven-plugin/project.xml,maven-jaxb-plugin/project.xml,catalogue-ejb-test/project.xml,thecookerybook/project.xml"
               goals="triemax-jalopy"
               banner="Formatting"
               ignoreFailures="false"/>
  </goal>

  <!-- Updates all projects from the source repository. -->
  <goal name="updateall">
    <m:reactor basedir="${basedir}/.."
               includes="*/project.xml"
               excludes="mavenbuild/project.xml"
               goals="scm:update-project"
               banner="Updating from Source Control"
               ignoreFailures="false"/>
  </goal>
  
  <!-- Compiles, tests and locally distributes all projects. -->
  <goal name="buildall">
    <m:reactor basedir="${basedir}/.."
               includes="*/project.xml"
               excludes="mavenbuild/project.xml"
               goals="dist"
               banner="Building"
               ignoreFailures="false"/>
  </goal>

  <!-- Compiles all projects. -->
  <goal name="compileall">
    <m:reactor basedir="${basedir}/.."
               includes="*/project.xml"
               excludes="mavenbuild/project.xml"
               goals="java:compile"
               banner="Compiling"
               ignoreFailures="false"/>
  </goal>

  <!-- Runs checkstyle on all projects. -->
  <goal name="checkstyleall">

    <j:set var="maven.checkstyle.fail.on.violation" scope="parent" value="true"/>

    <m:reactor basedir="${basedir}/.."
               includes="*/project.xml"
               excludes="mavenbuild/project.xml"
               goals="checkstyle"
               banner="Checkstyling"
               ignoreFailures="false"/>
  </goal>

  <!-- Builds all project sites and deploys them on the local file system. -->
  <goal name="updatesites">
    <attainGoal name="multiproject:site"/>
    <attainGoal name="site:fsdeploy"/>
  </goal>

  <!-- Tests all projects. -->
  <goal name="testall">
    <m:reactor basedir="${basedir}/.."
               includes="*/project.xml"
               excludes="mavenbuild/project.xml"
               goals="test:test"
               banner="Testing"
               ignoreFailures="false"/>
  </goal>

</project>
