# What Build Tools Does Jenkins Use? Maven, Ant, and the Build Pipeline Explained

> Discover the core build tools Jenkins leverages: Apache Maven for compilation and testing, and Apache Ant for script execution and build assistance. Understand their roles.

- Repository: [Jenkins/jenkins](https://github.com/jenkinsci/jenkins)
- Tags: deep-dive
- Published: 2026-07-30

---

**Jenkins is built and packaged with Apache Maven, which handles compilation, testing, and WAR assembly, while Apache Ant is embedded both as a library for executing user-defined build scripts and as a helper tool during the Maven build process itself.**

The open-source automation server Jenkins—hosted in the `jenkinsci/jenkins` GitHub repository—relies on a specific combination of build tools to compile its source code and to support the wide variety of build jobs it can execute. Understanding what build tools Jenkins uses is essential for contributors packaging the `jenkins.war` file and for administrators configuring build agents.

## Apache Maven: The Primary Build Tool

Jenkins uses **Apache Maven** as its sole build orchestration tool. The root [`pom.xml`](https://github.com/jenkinsci/jenkins/blob/main/pom.xml) file defines a multi-module project that drives the entire software lifecycle, from compilation to final artifact assembly.

In [`pom.xml`](https://github.com/jenkinsci/jenkins/blob/main/pom.xml), Maven coordinates several critical phases:

- **Compilation** of Java source files across modules such as `core`, `war`, and `cli`
- **Testing** via Surefire and JUnit configurations defined in [`test/pom.xml`](https://github.com/jenkinsci/jenkins/blob/main/test/pom.xml)
- **Code generation** using ANTLR for parsing tasks
- **License checking** to ensure compliance with dependency licenses
- **Assembly** of the final `jenkins.war` file via the [`war/pom.xml`](https://github.com/jenkinsci/jenkins/blob/main/war/pom.xml) module

According to the jenkinsci/jenkins source code, no Gradle build files are present in the repository, confirming that Maven is the exclusive build tool for the project itself.

## How Apache Ant Integrates with Jenkins

While Maven builds Jenkins itself, **Apache Ant** is integrated into the project in two distinct ways: as a runtime dependency for executing user builds, and as a build-time utility for ad-hoc scripting within the Maven lifecycle.

### Ant as a Runtime Library for Build Execution

Jenkins embeds Ant as a library to support `hudson.tasks.Ant`, the class that enables Jenkins jobs to run Ant build scripts on agents.

In [`core/pom.xml`](https://github.com/jenkinsci/jenkins/blob/main/core/pom.xml) (around line 240), the project declares a direct dependency on the Ant library:

```xml
<dependency>
    <groupId>org.apache.ant</groupId>
    <artifactId>ant</artifactId>
</dependency>

```

This dependency allows Jenkins controllers to dispatch Ant-based builds to agents without requiring a separate Ant installation on every node.

### Ant Tasks During the Maven Build

The Jenkins build process uses the `maven-antrun-plugin` to execute Ant tasks during specific Maven phases. In the root [`pom.xml`](https://github.com/jenkinsci/jenkins/blob/main/pom.xml) (around line 420), the plugin is configured to run ad-hoc scripts for additional setup steps that are more easily expressed in Ant than in Maven's native plugin ecosystem.

This configuration appears within the build plugins section:

```xml
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-antrun-plugin</artifactId>
    <executions>
        <execution>
            <phase>generate-sources</phase>
            <configuration>
                <target>
                    <!-- Example Ant task executed during Maven build -->
                    <echo message="Generating additional sources…" />
                </target>
            </configuration>
            <goals>
                <goal>run</goal>
            </goals>
        </execution>
    </executions>
</plugin>

```

## Key Build Configuration Files

The repository structure separates build concerns across multiple Maven modules. Here are the critical files that define how Jenkins is constructed:

| Module Path | Purpose |
|-------------|---------|
| [`pom.xml`](https://github.com/jenkinsci/jenkins/blob/main/pom.xml) (Root) | Defines the overall Maven multi-module build, plugin management, and artifact assembly. |
| [`core/pom.xml`](https://github.com/jenkinsci/jenkins/blob/main/core/pom.xml) | Declares Ant as a runtime dependency and contains core-specific compilation settings. |
| [`war/pom.xml`](https://github.com/jenkinsci/jenkins/blob/main/war/pom.xml) | Packages the `jenkins.war` using Maven and configures the embedded Jetty/Winstone server. |
| [`test/pom.xml`](https://github.com/jenkinsci/jenkins/blob/main/test/pom.xml) | Configures unit test execution (Surefire, JUnit) and includes the Ant library for test utilities. |
| [`cli/pom.xml`](https://github.com/jenkinsci/jenkins/blob/main/cli/pom.xml) | Builds the command-line client; also depends on the Ant library for scriptable actions. |
| [`bom/pom.xml`](https://github.com/jenkinsci/jenkins/blob/main/bom/pom.xml) | Generates the Maven Bill-of-Materials (BOM) for centralized dependency management. |

## Building Jenkins from Source

To build Jenkins locally using the Maven tool set, run the following command from the repository root:

```bash

# Fast build that skips tests

mvn clean install -DskipTests

```

This command compiles all modules, executes the ANTLR code generation, runs license checks, and assembles the final `jenkins.war` in the `war/target/` directory.

## Executing Ant Builds in Jenkins Pipelines

Because Jenkins includes Ant as a runtime library, you can execute Ant-based builds directly from Pipeline scripts without installing Ant on the agent. The `ant` step invokes the embedded Ant engine:

```groovy
pipeline {
    agent any
    stages {
        stage('Ant Build') {
            steps {
                ant targets: 'clean compile', buildFile: 'build.xml'
            }
        }
    }
}

```

This pipeline stage uses the `hudson.tasks.Ant` implementation internally, leveraging the same `org.apache.ant:ant` dependency declared in [`core/pom.xml`](https://github.com/jenkinsci/jenkins/blob/main/core/pom.xml).

## Summary

- **Apache Maven** is the exclusive build tool used to compile, test, and package Jenkins itself, orchestrated from the root [`pom.xml`](https://github.com/jenkinsci/jenkins/blob/main/pom.xml).
- **Apache Ant** is embedded as a runtime dependency in [`core/pom.xml`](https://github.com/jenkinsci/jenkins/blob/main/core/pom.xml) to support user-defined Ant builds via `hudson.tasks.Ant`.
- The **maven-antrun-plugin** executes Ant scripts during the Maven build lifecycle for setup tasks, configured in the root [`pom.xml`](https://github.com/jenkinsci/jenkins/blob/main/pom.xml) around line 420.
- No Gradle build files exist in the repository; the project relies entirely on the Maven + Ant combination.

## Frequently Asked Questions

### Does Jenkins use Gradle to build itself?

No. According to the source code analysis of the `jenkinsci/jenkins` repository, no Gradle build files are present. The project relies exclusively on Apache Maven as defined in the root [`pom.xml`](https://github.com/jenkinsci/jenkins/blob/main/pom.xml) and its submodules.

### What is the Maven AntRun plugin used for in Jenkins?

The `maven-antrun-plugin` (defined around line 420 in the root [`pom.xml`](https://github.com/jenkinsci/jenkins/blob/main/pom.xml)) executes ad-hoc Ant scripts during specific Maven phases, such as `generate-sources`. This allows the build to perform complex file manipulations or custom setup steps that are not easily handled by standard Maven plugins.

### How can I build the Jenkins WAR file locally?

Run `mvn clean install` from the repository root. To skip unit tests for faster builds, use `mvn clean install -DskipTests`. The assembled `jenkins.war` file will be located in `war/target/`.

### Why does Jenkins depend on Ant libraries if it uses Maven?

Jenkins declares `org.apache.ant:ant` as a dependency in [`core/pom.xml`](https://github.com/jenkinsci/jenkins/blob/main/core/pom.xml) to support the `hudson.tasks.Ant` functionality. This allows Jenkins controllers to execute Ant-based build jobs on agents using the embedded Ant runtime, rather than requiring a separate Ant installation on every build node.