---
title: Building and deploying with Ant
description: Use the Apache Ant build script to clean, build, package, and deploy projects within the PingFederate Java SDK.
component: pingfederate
version: 13.1
page_id: pingfederate:sdk_developers_guide:build_deploy_ant
canonical_url: https://docs.pingidentity.com/pingfederate/13.1/sdk_developers_guide/build_deploy_ant.html
llms_txt: https://docs.pingidentity.com/pingfederate/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
revdate: July 5, 2022
section_ids:
  about-this-task: About this task
  steps: Steps
---

# Building and deploying with Ant

Use the Apache Ant build script to clean, build, package, and deploy projects within the PingFederate Java SDK.

## About this task

The PingFederate Java SDK comes with an Apache Ant build script that simplifies building and deploying your projects.

## Steps

1. Edit the `build.local.properties` file and set the `target-plugin.name` property to the name of your project subdirectory (see [SDK directory structure](pf_sdk_direct_struct.html)).

   |   |                                                                                                                                                                                                                        |
   | - | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   |   | You can develop source code for multiple projects simultaneously, but you can build and deploy only one at a time. Change the value of the `target-plugin.name` property as needed to build and deploy other projects. |

2. If your project depends on any third-party `.jar` files, place them into your project's `lib` directory.

   If the directory does not exist, create a new directory called `lib` directly under your project's directory. For example, `pingfederate/sdk/plugin-src/<subproject-name>/lib`.

3. On the command line in the `sdk` directory, use `ant` to clean, build, and package or to build, package, and deploy your project.

   | Option                                       | Description          |
   | -------------------------------------------- | -------------------- |
   | Clean the project                            | `ant clean-plugin`   |
   | Compile the project                          | `ant compile-plugin` |
   | Compile the project and create a `.jar` file | `ant jar-plugin`     |

   |   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
   | - | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   |   | The SDK creates a deployment descriptor in the `PF_INF` directory and places it in a `.jar` file. The descriptor tells PingFederate what plugin implementations are contained in the file, and the compiled class files and the deployment descriptor are placed in the `pingfederate/sdk/plugin-src/<subproject-name>/build/classes` directory. The `pf.plugins.<subproject-name>.jar` file is placed in the `pingfederate/sdk/plugin-src/<subproject-name>/build/jar` directory. |

   To compile the project, create a .`jar` file, and deploy the project to PingFederate, enter:

   ```
   ant deploy-plugin
   ```

   This build target performs the steps described above and deploys any `.jar` files found in the `lib` directory of your subproject.

   |   |                                                                                                                                                                                                                    |
   | - | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
   |   | To deploy your plugin manually to an installation of the PingFederate server, copy the `.jar` file and any third-party`.jar` files into the `/server/default/deploy/` directory of that PingFederate installation. |

4. Restart the PingFederate server.
