Build Ant Applications

You can use Apache Ant to automate your build processes, as described in its build files:

  1. Upload the Ant build files (such as build.xml and build.properties) to the project Git repository.

  2. Open the job’s configuration page.

  3. In the Git tab, add the Git repository where you uploaded the build files.

  4. Click the Steps tab.

  5. From Add Step, select Ant.

  6. In Targets, specify the Ant targets or leave it empty to run the default Ant target specified in the build file.

  7. In Build File, specify the path of the build file.

  8. If necessary, in Properties, specify the values for properties used in the Ant build file:

    # comment
    name1=value1
    name2=$VAR2

    When a build runs, these values will be passed to Ant as -Dname1=value1 -Dname2=value2. You should always use $VAR for parameter references instead of using %VAR%). Use a double backslash (\\) to escape a backslash (\). Avoid using double-quotes ("). To define an empty property, use varname= in the script.

  9. If your build requires a custom ANT_OPTS, specify it in Java Options. You may use it to specify Java memory limits (example: -Xmx512m). Don’t specify other Ant options here (such as -lib), but specify them in Targets.

  10. Click Save.

For more information, see https://ant.apache.org/.