Ant

ID: ant

Description

This plugin adds Apache Ant support to Jenkins

This functionality used to be a part of the core, but as of Jenkins 1.431, it was split off into a separate plugin.

Installation and usage

Installation

For this plugin to be used, an Ant installation must be specified in the global Jenkins configuration. It can be installed automatically:

Or manually:

Usage

  • Ant Version: Ant Installation to use. See previous section.
  • Targets: Ant targets to invoke. If left blank, default target will be invoked.
  • Build File: Build file to use. If left blank, plugin will look for build.xml in the root directory.
  • Properties: Additional parameters (typical properties file format) to pass to the build. They are passed like -Dname=value
  • Java Options: Custom ANT_OPTS.

An example of using the Ant task inside Pipeline DSL. This code snippet must be put inside a step block when using the declarative syntax.

withAnt(installation: 'myinstall') {
    dir("scoring") {
    if (isUnix()) {
      sh "ant mytarget"
    } else {
      bat "ant mytarget"
    }
}

Changelog

Version 1.10 and later

See GitHub releases.

Version 1.9 and older

See the old changelog.

ArchivesGet past versions
Version: 1.11
Released:
Requires Jenkins 2.150.1
Installs: 240,963
Maintainers
Armando Fernandez
Help us improve this page!
To propose a change submit a pull request to the plugin page on GitHub.
Previous Security Warnings